From e58163ef5f2f3dc73a6915bc597c4ed51ba6b0d0 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 25 Jun 2023 16:13:58 -0400 Subject: [PATCH] Add more logging detail when _health endpoint fails --- server/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/index.ts b/server/index.ts index 26eadf6bd..0c950a299 100644 --- a/server/index.ts +++ b/server/index.ts @@ -93,13 +93,17 @@ async function start(id: number, disconnect: () => void) { try { await sequelize.query("SELECT 1"); } catch (err) { - throw new Error("Database connection failed"); + Logger.error("Database connection failed", err); + ctx.status = 500; + return; } try { await RedisAdapter.defaultClient.ping(); } catch (err) { - throw new Error("Redis ping failed"); + Logger.error("Redis ping failed", err); + ctx.status = 500; + return; } ctx.body = "OK";