From 7f170f1b7b9b209c2ca461dd8e167c94e4f35f8e Mon Sep 17 00:00:00 2001 From: Brian Beckerle <49686530+brainbicycle@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:02:50 +0200 Subject: [PATCH] chore: update unable to load tracking - send screen message if screen present, tab otherwise (#11001) send screen message if screen present, tab otherwise --- src/app/Components/LoadFailureView.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/app/Components/LoadFailureView.tsx b/src/app/Components/LoadFailureView.tsx index 0838884c92b..74d0d9406b0 100644 --- a/src/app/Components/LoadFailureView.tsx +++ b/src/app/Components/LoadFailureView.tsx @@ -61,13 +61,22 @@ export const LoadFailureView: React.FC = ({ if (shouldTrackError) { Sentry.withScope((scope) => { scope.setExtra("user-id", userId) + scope.setExtra("activeTab", activeTab) if (error) { - scope.setExtra("error", error) + scope.setExtra("error-details", error) } - Sentry.captureMessage( - "Unable to load in tab: " + activeTab + " params:" + JSON.stringify(routeParams), - "error" - ) + + if (routeParams) { + scope.setExtra("routeParams", JSON.stringify(routeParams)) + } + + const moduleName = routeParams?.moduleName + let message = "Unable to load in tab: " + activeTab + if (!!moduleName) { + message = "Unable to load in screen: " + moduleName + } + + Sentry.captureMessage(message, "error") }) } }