0.3.2 • Published 2 years ago

@brunocarvalho/error-handler v0.3.2

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

error-handler

A error handler for express APIs applications.

Installation

$ npm install --save @brunocarvalho/error-handler

usage

import express from 'express'
import errorHandler, { type RequestError } from '@brunocarvalho/error-handler'

const app = express()

app.get('/', (req, res) => {
  const err: RequestError = new Error('Not Found')
  err.reason = `item not found in database`
  err.statusCode = 404
  throw err
})

app.use(errorHandler())
0.3.0

2 years ago

0.3.2

2 years ago

0.2.11

4 years ago

0.2.10

5 years ago

0.2.9

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.8

5 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago