Error
Error is a library of extendable custom errors for node.js.
Installation
npm node-error --save
Usage
Errors in the library can be instantiated directly
var LoggableError = LoggableError; throw 'message';
or extended using .extend(name, [attributes])
:
var LoggableError = LoggableError; var { return memoryUsage: process ; } CustomError = LoggableError;
The attributes
argument to the extend
method is optional.
It can be of type object or function.
The function executes upon error instantiation and it should return an object.
var error = 'message'; console;
Errors
ExtendableError
ExtendableError is the base error to extend using .extend
method.
LoggableError
LoggableError is an error having the stack
property enumerable.
ProxiedError
var ProxiedError = ProxiedError; var error = ;