Generates custom Http errors
npm install @financial-times/ip-custom-errors

A module that generates custom HTTP errors
Install via npm:
``sh`
npm i -S @financial-times/ip-custom-errors
The module exposes three methods to generate the custom HTTP errors. You can use the one that fits your needs as follows:
javascript
const { HTTPError } = require('@financial-times/ip-custom-errors');
try {
...
throw new HTTPError(401,'Unauthorized','You are not allowed to access this resource')
} catch (err) {
console.error(err)
}`
$3
`javascript
const { HTTPStatusErrors } = require('@financial-times/ip-custom-errors');
try {
...
throw HTTPStatusErrors'400'
} catch (err) {
console.error(err)
}
`$3
`javascript
const { NotFound } = require('@financial-times/ip-custom-errors');
try {
...
throw NotFound("The resource you requested can't be found");
} catch (err) {
console.error(err)
}
``MIT