@ash-framework/http-error

Class for throwing http specific errors

Usage no npm install needed!

<script type="module">
  import ashFrameworkHttpError from 'https://cdn.skypack.dev/@ash-framework/http-error';
</script>

README

@ash-framework/http-error

The Media Suite

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status

Class for throwing http specific errors

Install

NPM

  • Install: npm install --save @ash-framework/http-error
  • Module: require('@ash-framework/http-error')

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

History

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

Backers

Maintainers

These amazing people are maintaining this project:

  • Richard Walker digitalsadhu@gmail.com

Sponsors

These amazing people have contributed finances to this project:

Become a sponsor!

Contributors

These amazing people have contributed code to this project:

License

Unless stated otherwise all works are:

and licensed under: