Error handling is broken in the controller #71

flanamacca opened this Issue Jan 30, 2013 · 3 comments


None yet
3 participants

Hey guys,

Taking a look at the controller error handler

Note that err and e when logged are both null. This stops any error handling middleware useless since they bypass null errors.

Controller.prototype.error = function(err) {
var self = this;
// Give controller-level after filters an opportunity to handle the error. If
// not handled, pass control out to Express for application-level handling.
this._devoke(err, function(e) {
console.log('Calling middleweare', err, e);
return self.__next(e);

FIX::: Controller.prototype._invoke = function(action) {
Line 451
try {
} catch (e) {
return self.error(err); <-------- Should be e


pixelfreak commented Jan 30, 2013

+1 I ran into this issue too.

Odd though, this worked using previous Express version (not sure which version, but definitely 3.0.5 below). After I upgrade to latest, I find that the error handling flow leaks outside the controller to the next middleware.

pixelfreak added a commit to pixelfreak/locomotive that referenced this issue Jan 30, 2013

Fixed Issue #71
Fixed broken error handling

jaredhanson commented Feb 20, 2013

Merged #73. @pixelfreak thanks for the patch!


pixelfreak commented Feb 20, 2013

Thanks for merging! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment