mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-07-06 04:51:44 -07:00
fix(backend/app.js): fix internal error handler
This commit is contained in:
parent
7b51fbc8c6
commit
15e4051625
1 changed files with 2 additions and 2 deletions
|
@ -87,8 +87,8 @@ app.use("/controller", routerController); // other controller-specific routes
|
||||||
app.get("*", async function (req, res) {
|
app.get("*", async function (req, res) {
|
||||||
res.status(404).json({ error: "404 Not found" });
|
res.status(404).json({ error: "404 Not found" });
|
||||||
});
|
});
|
||||||
app.use(async function (err, req, res) {
|
app.use(function (err, req, res, next) {
|
||||||
console.error(err.stack); // TODO: replace with production logger
|
console.error(err.stack);
|
||||||
res.status(500).json({ error: "500 Internal server error" });
|
res.status(500).json({ error: "500 Internal server error" });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue