From e8a5f8f056cf34d5e69d0c90138a1402e3e34b70 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Thu, 16 May 2024 09:28:38 +0100 Subject: [PATCH] Catch failed references index request (#18274) GitOrigin-RevId: 96063835056a39d85a57a77c0c7f71ce8243e6b9 --- .../features/ide-react/context/references-context.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/web/frontend/js/features/ide-react/context/references-context.tsx b/services/web/frontend/js/features/ide-react/context/references-context.tsx index 90463acde0..bf886c3f56 100644 --- a/services/web/frontend/js/features/ide-react/context/references-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/references-context.tsx @@ -19,6 +19,7 @@ import { ReactScopeValueStore } from '@/features/ide-react/scope-value-store/rea import { useFileTreeData } from '@/shared/context/file-tree-data-context' import { findDocEntityById } from '@/features/ide-react/util/find-doc-entity-by-id' import { IdeEvents } from '@/features/ide-react/create-ide-event-emitter' +import { debugConsole } from '@/utils/debugging' type References = { keys: string[] @@ -74,9 +75,14 @@ export const ReferencesProvider: FC = ({ children }) => { body: { shouldBroadcast, }, - }).then((response: IndexReferencesResponse) => { - storeReferencesKeys(response.keys, true) }) + .then((response: IndexReferencesResponse) => { + storeReferencesKeys(response.keys, true) + }) + .catch(error => { + // allow the request to fail + debugConsole.error(error) + }) }, [projectId, storeReferencesKeys] )