Class ClideError

An error thrown by the CLI engine.

This error is designed to ensure clean stack trace formatting even when minified and can be extended to create other error types with the same behavior.

class FooCliError extends ClideError {
constructor(message: string, options?: ErrorOptions) {
super(message, {
...options,
prefix: "🚨 ",
name: "Foo CLI Error",
});
}
}

throw new FooCliError("Something went wrong");
// 🚨 Foo CLI Error: Something went wrong
// at ...

Hierarchy (View Summary)

Constructors

Properties

Constructors

Properties

name: "CLI Error" = ...

Returns the name of the function. Function names are read-only and can not be changed.

prefix: string = '✖ '