@altipla/express-errors
v0.1.0
Published
Debug errors while developing with Express.
Readme
express-errors
Debug errors while developing with Express.
Installation
$ npm install @altipla/express-errorsUsage
Add the handler always at the very end of the middleware chain. It does not propagate the error, so any middleware below it will not be called.
import express from 'express'
import { errorHandler } from '@altipla/express-errors'
const app = express()
app.get('/', (req, res) => {
throw new Error('Something went wrong')
});
// (..add more routes here...)
app.use(errorHandler)