$ npm install --save @celeri/http-error
import { HttpError, errorHandler } from '@celeri/http-error';
const { HttpError, errorHandler } = require('@celeri/http-error');
// Create error objects to represent what went wrong
const error = new HttpError(404, 'Could not find the requested document');
// Create your middleware with a processor that takes in an HttpError and returns
// a response payload
const errorMiddleware = errorHandler(({ error }) => ({
error: error.message
}))