From 791ba642d1acbf2a84e3a35c2494c9617fa4b73c Mon Sep 17 00:00:00 2001 From: SelmaBergstrand Date: Fri, 29 Nov 2024 10:51:20 +0100 Subject: [PATCH] feat(sentry): capture to Sentry when departure fetch fails --- tavla/src/Board/scenarios/QuayTile/index.tsx | 13 +++++++++++++ tavla/src/Board/scenarios/StopPlaceTile/index.tsx | 13 +++++++++++++ tavla/src/Shared/graphql/utils.ts | 14 ++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/tavla/src/Board/scenarios/QuayTile/index.tsx b/tavla/src/Board/scenarios/QuayTile/index.tsx index 5b1bd6230..85badf398 100644 --- a/tavla/src/Board/scenarios/QuayTile/index.tsx +++ b/tavla/src/Board/scenarios/QuayTile/index.tsx @@ -11,6 +11,7 @@ import { FetchErrorTypes, } from 'Board/components/DataFetchingFailed' import { TTheme } from 'types/settings' +import * as Sentry from '@sentry/nextjs' export function QuayTile({ placeId, @@ -42,6 +43,18 @@ export function QuayTile({ } if (error || !data || !data.quay) { + Sentry.captureException( + new Error( + error + ? 'Unknown error occurred while fetching quay departures' + : 'Departure fetch for quay returned no data', + ), + { + extra: { + quayId: placeId, + }, + }, + ) return (