Class: CliError
A typed, PHI-safe CLI error. Its CliError.message | message is value-free by construction: callers must build it from codes, indices, offsets, format names, and file paths, never from an input value. It carries the ExitCode the invocation resolves to.
Example
import { CliError, CLI_CODES, EXIT } from "@cosyte/cli";
throw new CliError(CLI_CODES.CLI_NO_INPUT, EXIT.NOINPUT, "cannot read the named file");
Extends
Error
Constructors
Constructor
new CliError(
code,exit,message):CliError
Parameters
code
A stable CliCode.
exit
The ExitCode to resolve to.
message
string
A value-free explanation (positional/structural context only, never PHI).
Returns
CliError
Overrides
Error.constructor
Properties
code
readonlycode:CliCode
The stable diagnostic code.
exit
readonlyexit:ExitCode
The exit code this error resolves the invocation to.