From 90cb824578188f51eff1c010c08a7b16df0b1e66 Mon Sep 17 00:00:00 2001 From: owen Date: Sat, 21 Feb 2026 23:34:30 -0500 Subject: [PATCH] capture internal api error --- src/routes/status.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/routes/status.ts b/src/routes/status.ts index 2d9816ea..10051a0b 100644 --- a/src/routes/status.ts +++ b/src/routes/status.ts @@ -1,6 +1,7 @@ import { RaidHubRoute } from "@/core/RaidHubRoute" import { getDestiny2Status } from "@/integrations/bungie" import { InternalApiError } from "@/lib/utils/internal-api-client" +import { Logger } from "@/lib/utils/logging" import { cacheControl } from "@/middleware/cache-control" import { AtlasStatus, @@ -15,6 +16,8 @@ import { getInstanceBasic } from "@/services/instance/instance" import { getLatestInstanceByDate } from "@/services/instance/latest" import { z } from "zod" +const logger = new Logger("STATUS_ROUTE") + // This state tracks the status of the Destiny API and debounces it with a grace period of 60 seconds. export const statusState = { debounce: 60000, @@ -103,6 +106,13 @@ export const statusRoute = new RaidHubRoute({ }) } catch (err) { if (err instanceof InternalApiError) { + // log the error as a error for sentry + logger.error("INTERNAL_API_ERROR", err, { + serviceName: err.serviceName, + url: err.url.toString(), + status: err.status, + statusText: err.statusText + }) return RaidHubRoute.fail(ErrorCode.ServiceUnavailableError, { serviceName: err.serviceName, message: "Internal service unavailable"