[TS] Renamed file extensions to typescript
This commit is contained in:
parent
4d5b347767
commit
4a6f20fa7b
31 changed files with 12 additions and 0 deletions
17
lib/routes/error-route.ts
Normal file
17
lib/routes/error-route.ts
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