express-custom-error
A nodejs module that hacks into express in order to add custom error handling support
Installation
Install using npm
npm install express-custom-error --save
Usage
Just require this module and call it's method inject before using express,
this will inject the necessary code into the express module.
// Patch express with the inject method; // Then use express normallyconst express = ;
Example
// Inject express custom error into express with the inject methodconst inject errorHandler = ;; const express = ;const app = ; app // In order to handle errors, you can use the built in error handler middleware app; // If no error is found it will call the next middleware // Then you might want to handle not found routesapp app;