mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 02:24:17 +00:00
output an serverError
when a request has a unhandled error
This commit is contained in:
parent
c913e66c46
commit
2ef0844d34
@ -297,6 +297,14 @@ class Server {
|
||||
if (typeof this.params.onRouteError === "function") {
|
||||
return this.params.onRouteError(req, res, error)
|
||||
} else {
|
||||
if (!global.silentOutputServerErrors) {
|
||||
this.outputServerError({
|
||||
message: "Unhandled route error:",
|
||||
description: error.stack,
|
||||
ref: [endpoint.method, endpoint.route].join("|"),
|
||||
})
|
||||
}
|
||||
|
||||
return res.status(500).json({
|
||||
"error": error.message
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user