/** * Tagged error hierarchy for Ignition. * * Every error carries a `tag` discriminant for programmatic matching and a * structured `context` bag for diagnostic details. */ /** Discriminant tags for the error hierarchy. */ export type IgnitionErrorTag = "SSHConnectionError" | "SSHCommandError" | "TransferError" | "ResourceError" | "RecipeLoadError" | "InventoryError" | "CapabilityError"; /** Base class for all Ignition errors. */ export declare class IgnitionError extends Error { tag: IgnitionErrorTag; context: Record; constructor(tag: IgnitionErrorTag, message: string, context?: Record, cause?: Error); } /** Failed to establish an SSH connection to a host. */ export declare class SSHConnectionError extends IgnitionError { constructor(host: string, message: string, cause?: Error, port?: number); } /** An SSH command returned a non-zero exit code. */ export declare class SSHCommandError extends IgnitionError { exitCode: number; stdout: string; stderr: string; constructor(command: string, exitCode: number, stdout: string, stderr: string, cause?: Error); } /** File transfer (scp) failure. */ export declare class TransferError extends IgnitionError { constructor(localPath: string, remotePath: string, message: string, cause?: Error); } /** A resource's check() or apply() failed. */ export declare class ResourceError extends IgnitionError { constructor(resourceType: string, resourceName: string, message: string, cause?: Error); } /** Failed to load or parse a recipe file. */ export declare class RecipeLoadError extends IgnitionError { constructor(path: string, message: string, cause?: Error); } /** Failed to load or resolve inventory. */ export declare class InventoryError extends IgnitionError { constructor(path: string, message: string, cause?: Error); } /** * A transport does not support a required capability. * * Thrown when a resource requires a capability (e.g. 'transfer') that the * current transport does not support. */ export declare class CapabilityError extends IgnitionError { /** The capability that was required but not supported. */ capability: string; constructor(capability: string, resourceType: string, message?: string, cause?: Error); } /** * Determine whether an error is retryable (transient transport failure). * * Retryable: SSHConnectionError, TransferError (network-level issues). * Non-retryable: SSHCommandError (command exited non-zero — deterministic), * ResourceError, RecipeLoadError, InventoryError, unknown errors. */ export declare function isRetryable(error: unknown): boolean; //# sourceMappingURL=errors.d.ts.map