Created
July 2, 2014 08:29
-
-
Save ahri/0263b20f9234b908fe22 to your computer and use it in GitHub Desktop.
Why doesn't the middleware error handler get called?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require('express')(); | |
app.use(function (err, req, res, next) { | |
console.log("using my error middleware"); | |
return next(err); | |
}); | |
app.get('/', function (req, res, next) { | |
next(new Error("test")); | |
}); | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment