Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Error handling is broken in the controller #71

flanamacca opened this Issue · 3 comments

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


+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 pixelfreak referenced this issue from a commit in pixelfreak/locomotive
@pixelfreak pixelfreak Fixed Issue #71
Fixed broken error handling

Merged #73. @pixelfreak thanks for the patch!


Thanks for merging! :+1:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.