fix: return 500 for exceptions
This commit is contained in:
parent
66911677f0
commit
a7c679e610
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
|
@ -787,7 +787,7 @@ app.all("*", async (req, res) => {
|
|||
} catch (e) {
|
||||
const error = e.stack ? `${e}\n\n${e.stack}` : `${e}`;
|
||||
model.createLog(db, structure.id, route.id, error, true);
|
||||
return res.send(error);
|
||||
return res.status(500).send(error);
|
||||
}
|
||||
} else {
|
||||
res.status(404).json({ success: false, message: "Path not found" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue