From 9d1e6c2ec5341ae40f02e5727c5f72d7b757ac0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ra=C4=8D=C3=A1k?= Date: Mon, 3 Feb 2025 16:02:18 +0100 Subject: [PATCH] Capture error instead of object in explorerViews (#4516) Otherwise Sentry won't group the event correctly. --- baker/algolia/utils/explorerViews.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/baker/algolia/utils/explorerViews.ts b/baker/algolia/utils/explorerViews.ts index 99cafeed7d..548fce8d71 100644 --- a/baker/algolia/utils/explorerViews.ts +++ b/baker/algolia/utils/explorerViews.ts @@ -486,10 +486,12 @@ async function enrichRecordWithIndicatorData( const indicatorInfo = indicatorMetadataDictionary[firstYIndicator] if (!indicatorInfo) { - await logErrorAndMaybeCaptureInSentry({ - name: "ExplorerViewIndicatorMissing", - message: `Explorer with slug "${record.explorerSlug}" has a view with missing indicator metadata: ${record.viewQueryParams}.`, - }) + await logErrorAndMaybeCaptureInSentry( + new Error( + `Explorer with slug "${record.explorerSlug}" has a view ` + + `with missing indicator metadata: ${record.viewQueryParams}.` + ) + ) return }