Map errors to a Servie response. Compatible with
boom
andhttp-errors
.
npm install servie-errorhandler --save
import { Request } from "servie";
import { finalhandler } from "servie-finalhandler";
import { errorhandler } from "servie-errorhandler";
const app = compose([get(), post()]);
const req = new Request("/");
app(req, finalhandler(req)).catch(errorhandler(req));
This project is written using TypeScript and publishes the definitions directly to NPM.
Apache 2.0