4xx/5xx errors with their statusCode in it. ### Usage ``` js var BadRequestError = require('./http-errors').BadRequestError; function doSomethingBad() { throw new BadRequestError('It went bad!'); } try { doSomethingBad(); } catch (err) { assert.strictEqual(err.statusCode, 400); } ``` ### Features * **4xx/5xx status as errors classes** - Status text is the class name, e.g. UnauthorizedError, NotFoundError * **Status code property** - Error handlers can use the status code to send responses. * **Correct stack trace** - no extra stack frames, no double capturing of the stack trace ### Anti-patterns These are some things that I've seen in other proposed solutions that you should avoid. * `Error.call(this)` - creates another error object (wasting a bunch of time) and doesn't touch `this` at all * `Error.captureStackTrace(this, arguments.callee);` - works, but `arguments.callee` is deprecated, so don't use it * `this.stack = (new Error).stack` - this... I don't even...