Skip to content

Use next(err) #32

Description

@helenzhou6

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. 👍

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions