0.1.0 • Published 2 years ago

@altipla/express-errors v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

express-errors

Debug errors while developing with Express.

Installation

$ npm install @altipla/express-errors

Usage

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)
0.1.0

2 years ago