From ac727ffb9e7dc3c302f5eef2af0a2a9b70063ecf Mon Sep 17 00:00:00 2001 From: Scott Cooper Date: Tue, 18 Nov 2025 15:40:27 -0800 Subject: [PATCH] fix(issues): Remove sentry exception on invalid url This is user data so invalid urls are fully expected. Just recording noise. fixes JAVASCRIPT-31B4 --- .../events/interfaces/frame/utils.tsx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/static/app/components/events/interfaces/frame/utils.tsx b/static/app/components/events/interfaces/frame/utils.tsx index 41d3c29fd45026..272ee15376b495 100644 --- a/static/app/components/events/interfaces/frame/utils.tsx +++ b/static/app/components/events/interfaces/frame/utils.tsx @@ -1,5 +1,3 @@ -import * as Sentry from '@sentry/react'; - import {t} from 'sentry/locale'; import type {Event, Frame} from 'sentry/types/event'; import {EventOrGroupType} from 'sentry/types/event'; @@ -137,12 +135,8 @@ function getRootDomain(url: string): string { // Split hostname into parts and get the last two parts (if they exist) const parts = hostname.split('.'); return parts.slice(-2).join('.'); - } catch (err) { - // Capture to review edge cases and handle them properly - Sentry.withScope(scope => { - scope.setExtra('url', url); - Sentry.captureException(err); - }); + } catch { + // Invalid URLs are possible/expected return ''; } } @@ -156,12 +150,8 @@ function getRootDomain(url: string): string { function getProtocol(url: string): string { try { return new URL(url).protocol; - } catch (err) { - // Capture to review edge cases and handle them properly - Sentry.withScope(scope => { - scope.setExtra('url', url); - Sentry.captureException(err); - }); + } catch { + // Invalid URLs are possible/expected return ''; } }