herror

Simple HTTP error constructor, as if this problem is still open

Usage no npm install needed!

<script type="module">
  import herror from 'https://cdn.skypack.dev/herror';
</script>

README

npm

herror

Dependency Status

Simple HTTP error constructor, as if this problem is still open.

Example

var err = herror(403);

err.code
//=> 403

err.message
//=> "403 Forbidden"

err.toString()
//=> "Error: 403 Forbidden"

API

err = herror(code)

Make new error from HTTP status code.

Install

npm install herror

License

MIT