Skip to content

Commit

Permalink
fix: improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Jul 18, 2023
1 parent ea0caf2 commit eaae3f4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/routes/500.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ import { RouteRegistrator } from "../pkg"

export const register500Route: RouteRegistrator = (app, createHelpers) => {
app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
console.error(err.stack)
console.error(err, err.stack)
res.status(500).render("error", {
card: UserErrorCard({
title: "Internal Server Error",
cardImage: createHelpers?.(req, res).logoUrl,
backUrl: req.header("Referer") || "welcome",
error: {
id: "404",
id: "backend-error",
error: {
...err,
code: 500,
},
},
}),
Expand Down

0 comments on commit eaae3f4

Please sign in to comment.