Skip to content
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

Use next(err) #32

Open
helenzhou6 opened this issue Apr 20, 2018 · 0 comments
Open

Use next(err) #32

helenzhou6 opened this issue Apr 20, 2018 · 0 comments
Assignees

Comments

@helenzhou6
Copy link

if (err) next();

If you do next() then it will skip to the next middleware, which would in this case would be the 404 (page not found) page:

router.use(error.client);
router.use(error.server);

But since there is an error with the API, I think the error page should be the 500 server error page instead. A trick that we learnt from @jamiecoe was to use next(err) instead of next() to skip to the 500 middleware/page instead. 👍

@haydnba haydnba self-assigned this Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants