Skip to content

xstd-js/custom-error

Repository files navigation

npm (scoped) npm NPM npm type definitions

Shows a black logo in light color mode and a white one in dark color mode.

@xstd/custom-error

Custom error implementation.

📦 Installation

yarn add @xstd/custom-error
# or
npm install @xstd/custom-error --save

📜 Documentation

CustomError

interface CustomErrorOptions extends Readonly<ErrorOptions> {
  readonly message?: string;
}

/**
 * A Custom Error with a specific name.
 */
declare class CustomError<GName extends string = string> extends Error {
  readonly name: GName;

  constructor(name: GName, options?: CustomErrorOptions);
}

About

Custom error implementation

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published