aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/server.ts b/server.ts
index 6073d2ea4..63a08f471 100644
--- a/server.ts
+++ b/server.ts
@@ -258,9 +258,16 @@ app.use((err, _req, res: express.Response, _next) => {
258 if (err) { 258 if (err) {
259 error = err.stack || err.message || err 259 error = err.stack || err.message || err
260 } 260 }
261
261 // Handling Sequelize error traces 262 // Handling Sequelize error traces
262 const sql = err.parent ? err.parent.sql : undefined 263 const sql = err?.parent ? err.parent.sql : undefined
263 logger.error('Error in controller.', { err: error, sql }) 264
265 // Help us to debug SequelizeConnectionAcquireTimeoutError errors
266 const activeRequests = err?.name === 'SequelizeConnectionAcquireTimeoutError' && typeof (process as any)._getActiveRequests !== 'function'
267 ? (process as any)._getActiveRequests()
268 : undefined
269
270 logger.error('Error in controller.', { err: error, sql, activeRequests })
264 271
265 return res.fail({ 272 return res.fail({
266 status: err.status || HttpStatusCode.INTERNAL_SERVER_ERROR_500, 273 status: err.status || HttpStatusCode.INTERNAL_SERVER_ERROR_500,