Skip to content

Commit f3d2ed7

Browse files
committed
Error handler bug fix
1 parent 39252b0 commit f3d2ed7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

generated/server/app/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ app.use('/api', require('./routes'));
1414

1515

1616
/*
17-
This middleware will catch any URLs resembling a file extension
18-
for example: .js, .html, .css
19-
This allows for proper 404s instead of the wildcard '/*' catching
20-
URLs that bypass express.static because the given file does not exist.
21-
*/
17+
This middleware will catch any URLs resembling a file extension
18+
for example: .js, .html, .css
19+
This allows for proper 404s instead of the wildcard '/*' catching
20+
URLs that bypass express.static because the given file does not exist.
21+
*/
2222
app.use(function (req, res, next) {
2323

2424
if (path.extname(req.path).length > 0) {
@@ -34,7 +34,7 @@ app.get('/*', function (req, res) {
3434
});
3535

3636
// Error catching endware.
37-
app.use(function (err, req, res) {
38-
// console.error(err);
37+
app.use(function (err, req, res, next) {
38+
console.error(err);
3939
res.status(err.status || 500).send(err.message || 'Internal server error.');
4040
});

0 commit comments

Comments
 (0)