ExitError
Error thrown by adapter implementations that model process exit as an exception instead of terminating immediately.
Runtime and CLI dispatch layers can catch this to perform real process termination, while tests can assert on exit codes without killing the runner:
try {
await cli.run({ adapter: createTestAdapter() });
} catch (e) {
if (e instanceof ExitError) expect(e.code).toBe(0);
}- Import:
@kjanat/dreamcli/runtime - Export kind: class
- Declared in:
src/runtime/adapter.ts - Source link:
packages/dreamcli/src/runtime/adapter.ts:226
Signatures
class ExitError extends Error {}Members
Constructors
constructor
constructor();Properties
cause
The cause of the error.
cause?: unknown;code
The exit code passed to exit().
code: number;message
message: string;name
Error name — always 'ExitError' for instanceof checks.
name: "ExitError";stack
stack?: string;stackTraceLimit
The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
stackTraceLimit: number;Methods
captureStackTrace
captureStackTrace(targetObject: object, constructorOpt?: Function): void;isError
isError(error: unknown): error is Error;prepareStackTrace
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;