From bf60bef3551ed3e0fd5beaf1901a27ebcdad90fd Mon Sep 17 00:00:00 2001 From: Abdullah Khan Date: Mon, 5 May 2025 11:50:18 -0400 Subject: [PATCH] feat(trace-eap-waterfall): Triggering missing project exception only when query is enabled --- static/app/views/explore/hooks/useTraceItemDetails.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/app/views/explore/hooks/useTraceItemDetails.tsx b/static/app/views/explore/hooks/useTraceItemDetails.tsx index 42eac30d310d2e..3e4167e5c6319e 100644 --- a/static/app/views/explore/hooks/useTraceItemDetails.tsx +++ b/static/app/views/explore/hooks/useTraceItemDetails.tsx @@ -77,7 +77,8 @@ export function useTraceItemDetails(props: UseTraceItemDetailsProps) { const project = useProjectFromId({project_id: props.projectId}); const enabled = (props.enabled ?? true) && !!project; - if (!project) { + // Only capture exception if the project is not found and the query is enabled. + if ((props.enabled ?? true) && !project) { captureException( new Error(`Project "${props.projectId}" not found in useTraceItemDetails`) );