Customizable error
Description
Let you define an error with custom fields to pass extra informations with message
Installation
npm i --save customizable-error
Using the factory
; // some code that throw an error { ;} // some code that handles the error const errorHandler = { resstatuserr;};
Extending the class
; { super name: 'SuperError' code: 'SUPER_ERROR' message: 'this is an error message' status: 500 foo: 'bar' baz: 'bat' } // some code that throw an error { ;} // some code that handles the errorconst errorHandler = { resstatuserr;};