fix outputServerError

This commit is contained in:
srgooglo 2022-05-06 11:38:54 +02:00
parent 0142d8d50c
commit f9edc5e7d0

View File

@ -171,11 +171,13 @@ class Server {
this.registerWSEndpoint(endpoint) this.registerWSEndpoint(endpoint)
}) })
} catch (error) { } catch (error) {
outputServerError({ if (!global.silentOutputServerErrors) {
message: "Controller initialization failed:", outputServerError({
description: error.stack, message: "Controller initialization failed:",
ref: controller.refName ?? controller.name, description: error.stack,
}) ref: controller.refName ?? controller.name,
})
}
} }
} }
} }
@ -298,7 +300,7 @@ class Server {
return this.params.onRouteError(req, res, error) return this.params.onRouteError(req, res, error)
} else { } else {
if (!global.silentOutputServerErrors) { if (!global.silentOutputServerErrors) {
this.outputServerError({ outputServerError({
message: "Unhandled route error:", message: "Unhandled route error:",
description: error.stack, description: error.stack,
ref: [endpoint.method, endpoint.route].join("|"), ref: [endpoint.method, endpoint.route].join("|"),