Skip to content

PromptCancelledError ​

The user stopped an interaction. Unlike a skipped schema prompt, this aborts execution.

Signatures ​

ts
class PromptCancelledError extends CLIError {}

Members ​

Constructors ​

constructor ​

Create an interaction cancellation with the conventional interrupt exit code.

ts
constructor(reason?: PromptCancelledError["reason"]);

Properties ​

name ​

Structured error class name.

ts
name: string;

reason ​

Cancellation source, when available from the engine.

ts
reason: "interrupt" | "escape" | "eof" | "cancel";

code ​

Stable machine-readable identifier.

ts
code: import("#internals/core/errors/index.ts").ErrorCode;

exitCode ​

Process exit code (defaults to 1).

ts
exitCode: number;

suggest ​

One-liner actionable hint.

ts
suggest: string | undefined;

details ​

Structured payload for machine output.

ts
details: Readonly<Record<string, unknown>> | undefined;

toJSON ​

Serialise to a plain object suitable for JSON output.

details is projected onto JSON-representable values: bigints become decimal digits and entries JSON cannot carry are omitted. The error object itself keeps the runtime values.

ts
toJSON: () => import("#internals/core/errors/index.ts").CLIErrorJSON;

message ​

ts
message: string;

stack ​

ts
stack?: string | undefined;

cause ​

ts
cause?: unknown;

isError ​

Indicates whether the argument provided is a built-in Error instance or not.

ts
isError: (error: unknown) => error is Error;

See Also ​

Released under the MIT License.