File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { RaidHubRoute } from "@/core/RaidHubRoute"
22import { getDestiny2Status } from "@/integrations/bungie"
33import { InternalApiError } from "@/lib/utils/internal-api-client"
4+ import { Logger } from "@/lib/utils/logging"
45import { cacheControl } from "@/middleware/cache-control"
56import {
67 AtlasStatus ,
@@ -15,6 +16,8 @@ import { getInstanceBasic } from "@/services/instance/instance"
1516import { getLatestInstanceByDate } from "@/services/instance/latest"
1617import { z } from "zod"
1718
19+ const logger = new Logger ( "STATUS_ROUTE" )
20+
1821// This state tracks the status of the Destiny API and debounces it with a grace period of 60 seconds.
1922export const statusState = {
2023 debounce : 60000 ,
@@ -103,6 +106,13 @@ export const statusRoute = new RaidHubRoute({
103106 } )
104107 } catch ( err ) {
105108 if ( err instanceof InternalApiError ) {
109+ // log the error as a error for sentry
110+ logger . error ( "INTERNAL_API_ERROR" , err , {
111+ serviceName : err . serviceName ,
112+ url : err . url . toString ( ) ,
113+ status : err . status ,
114+ statusText : err . statusText
115+ } )
106116 return RaidHubRoute . fail ( ErrorCode . ServiceUnavailableError , {
107117 serviceName : err . serviceName ,
108118 message : "Internal service unavailable"
You can’t perform that action at this time.
0 commit comments