1.0.2 • Published 5 years ago

middleware-err-handler v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

middleware-err-handler

middleware-err-handler recieves one boobleam property, if this is set to true it will understand that the code is running in production. If the code is 500 or higher, always will return 'internal server error', if the code is below 500 will return the error.message. If the boobleam property is set to false, then it will understand that is running in developer mode, so will always return de error.message and the error.stack

Example: const middlewareErrHandler = require('middleware-err-handler') app.use(middlewareErrHandler({ isProduction: NODE_ENV === 'production' }))