Error Classes
Error Hierarchy
Section titled “Error Hierarchy”Error├── ConnectorError├── OperationError├── AbortError├── TimeoutError├── ExecError└── AggregateError └── ApplyErrorConnectorError
Section titled “ConnectorError”Reports transport-level failures such as refused connections or authentication errors.
import { ConnectorError } from 'sysopkit';
class ConnectorError extends Error { name: 'ConnectorError'; constructor(message: string, conn: Connector);}| Property | Type | Description |
|---|---|---|
conn |
Connector |
The connector that failed |
OperationError
Section titled “OperationError”Wraps the underlying cause of an operation failure.
import { OperationError } from 'sysopkit';
class OperationError extends Error { name: 'OperationError'; constructor(message: string, cause?: Error);}| Property | Type | Description |
|---|---|---|
cause |
Error | undefined |
The underlying error |
AbortError
Section titled “AbortError”Reports execution cancelled via AbortSignal. Use isAbortError() to check safely across realm boundaries.
import { AbortError, isAbortError } from 'sysopkit';
class AbortError extends Error { name: 'AbortError'; constructor(message?: string); // default: 'Aborted'}
function isAbortError(err: unknown): boolean;TimeoutError
Section titled “TimeoutError”Reports an operation that exceeded the time limit set by timeout().
import { TimeoutError } from 'sysopkit';
class TimeoutError extends Error { name: 'TimeoutError'; constructor(message?: string);}ExecError
Section titled “ExecError”Reports a command execution failure, carrying the command, exit code, and full output.
import { ExecError } from 'sysopkit';
class ExecError extends Error { name: 'ExecError'; constructor(message: string, cmd: string[], exitCode: number, stdout: string, stderr: string);}| Property | Type | Description |
|---|---|---|
cmd |
string[] |
The command that failed |
exitCode |
number |
Process exit code |
stdout |
string |
Full stdout output |
stderr |
string |
Full stderr output |
ApplyError
Section titled “ApplyError”Reports multi-host apply failures and extends AggregateError with per-host results.
import { ApplyError } from 'sysopkit';
class ApplyError<R = unknown> extends AggregateError { name: 'ApplyError'; constructor(errors: unknown[], message: string, results: ApplyResult<R>[]);}| Property | Type | Description |
|---|---|---|
results |
ApplyResult<R>[] |
Per-host success/failure results |
type ApplyResult<T> = ApplySuccess<T> | ApplyFailure;
interface ApplySuccess<T> { success: true; conn: Connector; result: T;}
interface ApplyFailure { success: false; conn: Connector; error: unknown;}ShellError
Section titled “ShellError”The error thrown by sh() and bash() operations for non-zero exit codes outside the 64-78 BSD usage-error range.
import { ShellError } from 'sysopkit/op/sh';
class ShellError extends ExecError { // inherits cmd, exitCode, stdout, stderr from ExecError}