1.0.3 • Published 8 years ago

@ash-framework/http-error v1.0.3

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

Class for throwing http specific errors

NPM

Usage

Api

new HttpError(code, message)

With status code but no message

const error = new HttpError(404)

error.status // 404
error.message // 'Not Found'
error.name // 'HttpError'
error.stack // will output stack trace

With status code and custom message

const error = new HttpError(404, 'custom error message')

error.status // 404
error.message // 'custom error message'
error.name // 'HttpError'
error.stack // will output stack trace

Discover the release history by heading on over to the releases page.

These amazing people are maintaining this project:

These amazing people have contributed finances to this project:

Become a sponsor!

These amazing people have contributed code to this project:

Unless stated otherwise all works are:

and licensed under: