From 42236ef0f09c72bebf0838b5b675df05d2db2054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Tue, 25 Mar 2025 20:51:40 +0100 Subject: [PATCH] feat(admin/check-fire-engine): better logging --- apps/api/src/controllers/v0/admin/check-fire-engine.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api/src/controllers/v0/admin/check-fire-engine.ts b/apps/api/src/controllers/v0/admin/check-fire-engine.ts index 7073415c..f8bf8beb 100644 --- a/apps/api/src/controllers/v0/admin/check-fire-engine.ts +++ b/apps/api/src/controllers/v0/admin/check-fire-engine.ts @@ -16,7 +16,7 @@ export async function checkFireEngine(req: Request, res: Response) { const timeout = setTimeout(() => controller.abort(), 30000); const urls = ["https://roastmywebsite.ai", "https://example.com"]; - let lastError: string | null = null; + let lastError: any = null; for (const url of urls) { try { @@ -57,7 +57,11 @@ export async function checkFireEngine(req: Request, res: Response) { } // If we get here, all retries failed - logger.error(lastError); + logger.error("An error occurred while checking fire-engine", { + module: "admin", + method: "checkFireEngine", + error: lastError, + }); Sentry.captureException(lastError); return res.status(500).json({ success: false,