[FEATURE} Adjust error handling and bump versions
This commit is contained in:
parent
d47a8c3cc4
commit
360dd32860
19 changed files with 1052 additions and 455 deletions
17
lib/routes/error-route.js
Normal file
17
lib/routes/error-route.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
export function logErrors(err, req, res, next) {
|
||||
console.error(err.stack);
|
||||
next(err);
|
||||
}
|
||||
|
||||
export function clientErrorHandler(err, req, res, next) {
|
||||
if (req.xhr) {
|
||||
res.status(500).send({ error: "Something failed!" });
|
||||
} else {
|
||||
next(err);
|
||||
}
|
||||
}
|
||||
|
||||
export function errorHandler(err, req, res, next) {
|
||||
res.status(500);
|
||||
res.render("error", { error: err });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue