Nodeschool Public Materials

    extendable-error
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.7 • Public • Published

    Extendable Error Build Status

    A simple abstract extendable error class that extends Error, which handles the error name, message and stack property.

    Install

    npm install extendable-error --save

    Usage

    import ExtendableError from 'extendable-error';
     
    class SomeError extends ExtendableError {
      constructor(
        message: string,
        public code: number
      ) {
        super(message);
      }
    }
     
    let someError = new SomeError('Some error', 0x0001);

    License

    MIT License.

    Keywords

    none

    Install

    npm i extendable-error

    DownloadsWeekly Downloads

    190,608

    Version

    0.1.7

    License

    MIT

    Unpacked Size

    6.61 kB

    Total Files

    6

    Last publish

    Collaborators

    • vilic