Base Error with code of http error

Web Error

Custom error object with code of http error

You can use this library as AMD, CommonJS or root library in your Webpack or RequireJS module bundler. Works in the browser, in NodeJS, Bower and with Browserify.


var WebError = require('web-error');

var error = new WebError(404);

(error instanceof Error).should.equal(true);
(error instanceof WebError).should.equal(true);