Skip to content

Error Classes

Error
├── ConnectorError
├── OperationError
├── AbortError
├── TimeoutError
├── ExecError
└── AggregateError
└── ApplyError

Transport-level failures — connection refused, authentication failure, etc.

import { ConnectorError } from 'sysopkit';
class ConnectorError extends Error {
name: 'ConnectorError';
constructor(message: string, conn: Connector);
}
PropertyTypeDescription
connConnectorThe connector that failed

Operation-specific failures wrapping an underlying cause.

import { OperationError } from 'sysopkit';
class OperationError extends Error {
name: 'OperationError';
constructor(message: string, cause?: Error);
}
PropertyTypeDescription
causeError | undefinedThe underlying error

Execution was 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;

Operation exceeded the time limit set by timeout().

import { TimeoutError } from 'sysopkit';
class TimeoutError extends Error {
name: 'TimeoutError';
constructor(message?: string);
}

Command execution failure. Carries 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);
}
PropertyTypeDescription
cmdstring[]The command that failed
exitCodenumberProcess exit code
stdoutstringFull stdout output
stderrstringFull stderr output

Multi-host apply failures. 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>[]);
}
PropertyTypeDescription
resultsApplyResult<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;
}

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
}