Skip to content

Instantly share code, notes, and snippets.

@spikebrehm
Created October 25, 2013 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spikebrehm/7147893 to your computer and use it in GitHub Desktop.
Save spikebrehm/7147893 to your computer and use it in GitHub Desktop.
//config/errorHandler.js
exports.logErrors = function(options) {
return function(err, req, res, next) {
// do something with options
console.error(err);
next(err);
};
}
//app.js
var errorHandler = require('./config/errorHandler');
app.use(errorHandler.logErrors({dumpExceptions: true}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment