ts-custom-error

  • Version 3.3.1
  • Published
  • 58.1 kB
  • No dependencies
  • MIT license

Install

npm i ts-custom-error
yarn add ts-custom-error
pnpm add ts-custom-error

Overview

Extend native Error to create custom errors

Index

Functions

function customErrorFactory

customErrorFactory: <Properties extends CustomErrorProperties>(
fn: CustomErrorFunction<Properties>,
parent?: GenericErrorConstructor
) => CustomErrorConstructor<Properties>;

    Classes

    class CustomError

    class CustomError extends Error {}

      constructor

      constructor(message?: string, options?: ErrorOptions);

        property name

        name: string;

          Interfaces

          interface CustomErrorConstructor

          interface CustomErrorConstructor<Properties extends CustomErrorProperties>
          extends ErrorConstructor {}

            property prototype

            readonly prototype: CustomErrorInterface;

              construct signature

              new (...args: any[]): CustomErrorInterface & Properties;

                call signature

                (...args: any[]): CustomErrorInterface & Properties;

                  interface CustomErrorInterface

                  interface CustomErrorInterface extends Error {}

                    interface CustomErrorProperties

                    interface CustomErrorProperties {}

                      index signature

                      [property: string]: any;

                        Type Aliases

                        type GenericErrorConstructor

                        type GenericErrorConstructor =
                        | ErrorConstructor
                        | EvalErrorConstructor
                        | RangeErrorConstructor
                        | ReferenceErrorConstructor
                        | SyntaxErrorConstructor
                        | TypeErrorConstructor
                        | URIErrorConstructor
                        | CustomErrorConstructor<CustomErrorProperties>;

                          Package Files (1)

                          Dependencies (0)

                          No dependencies.

                          Dev Dependencies (18)

                          Peer Dependencies (0)

                          No peer dependencies.

                          Badge

                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/ts-custom-error.

                          • Markdown
                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/ts-custom-error)
                          • HTML
                            <a href="https://www.jsdocs.io/package/ts-custom-error"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>