error-handler-nt
v1.0.2
Published
Simple error handler that can create, cast, send and log an error.
Downloads
3
Readme
ErrorHandler
Module that provides functions for error handling.
Installation
$ npm install error-handler-nt --save
Documentation
create(status = 500, message = "", origin = "")
Returns CError object
cast(err, origin = "")
Cast error to CError
send(res, err)
Send the error as a response (only for Express framework)
createAndSend(res, status = 500, message = "", origin = "")
Create and send an error in the same function (only for Express framework)
log(err)
Log the error