Skip to content

ValidationErrorOptions ​

Options for ValidationError. Code is narrowed to validation-specific codes.

Signatures ​

ts
interface ValidationErrorOptions extends Omit<CLIErrorOptions, "code" | "exitCode"> {}

Members ​

Properties ​

cause ​

Original error, if this wraps another.

ts
cause?: unknown;

code ​

Validation-category error code (e.g. 'REQUIRED_FLAG', 'INVALID_ENUM').

ts
code: ValidationErrorCode;

details ​

Arbitrary structured payload (serialised in --json mode).

ts
details?: Readonly<Record<string, unknown>>;

exitCode ​

Process exit code for validation failures.

ts
exitCode?: number;

suggest ​

One-liner actionable hint shown to the user.

ts
suggest?: string;

See Also ​

Released under the MIT License.