Skip to content

Class: CommandNotFoundError ​

Error raised when a command cannot be resolved.

Each instance carries a non-enumerable brand keyed by Symbol.for('gunshi.CommandNotFoundError'), so that isCommandNotFoundError recognizes it even when it was created by another bundled copy of gunshi.

Extends ​

  • Error

Signature ​

ts
export class CommandNotFoundError extends Error

Constructors ​

Constructor ​

ts
new CommandNotFoundError(message: string, options: CommandNotFoundErrorOptions): CommandNotFoundError;

Create a command-not-found error.

Parameters ​

NameTypeDescription
messagestringFallback error message
optionsCommandNotFoundErrorOptionsCommand-not-found metadata

Returns ​

CommandNotFoundError

Properties ​

NameTypeDescription
candidates (readonly)readonly string[]
code (optional, readonly)CommandNotFoundErrorCode
commandName (readonly)string
commandPath (readonly)readonly string[]
values (readonly)Record<string, unknown>

Released under the MIT License.