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.

Readme

Keywords

none

Package Sidebar

Install

npm i extendable-error

Weekly Downloads

526,735

Version

0.1.7

License

MIT

Unpacked Size

6.61 kB

Total Files

6

Last publish

Collaborators

  • vilicvane