New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directly invoke error middleware #1085

wants to merge 5 commits into
base: master
Jump to file or symbol
Failed to load files and symbols.
+7 −3
Diff settings


Just for now

Viewing a subset of changes. View all

ignore prev error middleware

  • Loading branch information...
流香 committed Sep 9, 2016
commit 58108aa5359ae59acb0b3327c870a45e837f51c2
@@ -155,19 +155,23 @@ proto.handle = function handle(req, res, out) {
var layer;
if (err) {
layer = errware[errIndex++];
// move stack pointer
if (layer) index = layer.index;
} else {
layer = stack[index++];
// all done
if (!layer) {
defer(done, err);
if (layer.index) {
// ignore prev error middleware
if (index > layer.index) return next(err);
// move to non-error index
index = layer.index;
// route data
var path = parseUrl(req).pathname || '/';
var route = layer.route;
ProTip! Use n and p to navigate between commits in a pull request.