From 93e1cd44c68bacb0194ed62e9d366d1088aa2d29 Mon Sep 17 00:00:00 2001 From: rstar327 <114364448+rstar327@users.noreply.github.com> Date: Mon, 13 Oct 2025 17:13:11 +0300 Subject: [PATCH] fix: (frontend) clean up unsed error variable in try/catch block (#11325) --- .../src/api/conversation-service/conversation-service.api.ts | 2 +- frontend/src/components/features/chat/interactive-chat-box.tsx | 2 +- .../conversation-panel/conversation-card/conversation-card.tsx | 2 +- .../features/home/git-repo-dropdown/use-url-search.tsx | 2 +- .../components/features/payment/cancel-subscription-modal.tsx | 2 +- .../src/components/features/settings/create-api-key-modal.tsx | 2 +- .../src/components/features/settings/delete-api-key-modal.tsx | 2 +- frontend/src/context/conversation-subscriptions-provider.tsx | 2 +- frontend/src/entry.client.tsx | 2 +- frontend/src/hooks/use-conversation-name-context-menu.ts | 2 +- frontend/src/utils/vscode-url-helper.ts | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/src/api/conversation-service/conversation-service.api.ts b/frontend/src/api/conversation-service/conversation-service.api.ts index f426b56a48..04724d78ab 100644 --- a/frontend/src/api/conversation-service/conversation-service.api.ts +++ b/frontend/src/api/conversation-service/conversation-service.api.ts @@ -121,7 +121,7 @@ class ConversationService { reason?: string; }>(url); return data; - } catch (error) { + } catch { // Error checking if feedback exists return { exists: false }; } diff --git a/frontend/src/components/features/chat/interactive-chat-box.tsx b/frontend/src/components/features/chat/interactive-chat-box.tsx index 167ce88ebd..2818cd09e6 100644 --- a/frontend/src/components/features/chat/interactive-chat-box.tsx +++ b/frontend/src/components/features/chat/interactive-chat-box.tsx @@ -120,7 +120,7 @@ export function InteractiveChatBox({ // Step 5: Handle failed results handleFailedFiles(fileResults, imageResults); - } catch (error) { + } catch { // Clear loading states and show error clearLoadingStates(validFiles, validImages); displayErrorToast("An unexpected error occurred while processing files"); diff --git a/frontend/src/components/features/conversation-panel/conversation-card/conversation-card.tsx b/frontend/src/components/features/conversation-panel/conversation-card/conversation-card.tsx index 13a3a1402b..00f13083de 100644 --- a/frontend/src/components/features/conversation-panel/conversation-card/conversation-card.tsx +++ b/frontend/src/components/features/conversation-panel/conversation-card/conversation-card.tsx @@ -90,7 +90,7 @@ export function ConversationCard({ } } // VS Code URL not available - } catch (error) { + } catch { // Failed to fetch VS Code URL } } diff --git a/frontend/src/components/features/home/git-repo-dropdown/use-url-search.tsx b/frontend/src/components/features/home/git-repo-dropdown/use-url-search.tsx index c6c6159f52..76199c0666 100644 --- a/frontend/src/components/features/home/git-repo-dropdown/use-url-search.tsx +++ b/frontend/src/components/features/home/git-repo-dropdown/use-url-search.tsx @@ -23,7 +23,7 @@ export function useUrlSearch(inputValue: string, provider: Provider) { ); setUrlSearchResults(repositories); - } catch (error) { + } catch { setUrlSearchResults([]); } finally { setIsUrlSearchLoading(false); diff --git a/frontend/src/components/features/payment/cancel-subscription-modal.tsx b/frontend/src/components/features/payment/cancel-subscription-modal.tsx index b479f94f44..5c4a67abfc 100644 --- a/frontend/src/components/features/payment/cancel-subscription-modal.tsx +++ b/frontend/src/components/features/payment/cancel-subscription-modal.tsx @@ -28,7 +28,7 @@ export function CancelSubscriptionModal({ await cancelSubscriptionMutation.mutateAsync(); displaySuccessToast(t(I18nKey.PAYMENT$SUBSCRIPTION_CANCELLED)); onClose(); - } catch (error) { + } catch { displayErrorToast(t(I18nKey.ERROR$GENERIC)); } }; diff --git a/frontend/src/components/features/settings/create-api-key-modal.tsx b/frontend/src/components/features/settings/create-api-key-modal.tsx index b97d29f349..4c4c0242d0 100644 --- a/frontend/src/components/features/settings/create-api-key-modal.tsx +++ b/frontend/src/components/features/settings/create-api-key-modal.tsx @@ -39,7 +39,7 @@ export function CreateApiKeyModal({ onKeyCreated(newKey); displaySuccessToast(t(I18nKey.SETTINGS$API_KEY_CREATED)); setNewKeyName(""); - } catch (error) { + } catch { displayErrorToast(t(I18nKey.ERROR$GENERIC)); } }; diff --git a/frontend/src/components/features/settings/delete-api-key-modal.tsx b/frontend/src/components/features/settings/delete-api-key-modal.tsx index ae3d921dc2..2bcb282227 100644 --- a/frontend/src/components/features/settings/delete-api-key-modal.tsx +++ b/frontend/src/components/features/settings/delete-api-key-modal.tsx @@ -32,7 +32,7 @@ export function DeleteApiKeyModal({ await deleteApiKeyMutation.mutateAsync(keyToDelete.id); displaySuccessToast(t(I18nKey.SETTINGS$API_KEY_DELETED)); onClose(); - } catch (error) { + } catch { displayErrorToast(t(I18nKey.ERROR$GENERIC)); } }; diff --git a/frontend/src/context/conversation-subscriptions-provider.tsx b/frontend/src/context/conversation-subscriptions-provider.tsx index 54a624028f..74217cf513 100644 --- a/frontend/src/context/conversation-subscriptions-provider.tsx +++ b/frontend/src/context/conversation-subscriptions-provider.tsx @@ -275,7 +275,7 @@ export function ConversationSubscriptionsProvider({ setActiveConversationIds((prev) => prev.includes(conversationId) ? prev : [...prev, conversationId], ); - } catch (error) { + } catch { // Clean up the event handler if there was an error delete eventHandlersRef.current[conversationId]; } diff --git a/frontend/src/entry.client.tsx b/frontend/src/entry.client.tsx index b4de43821b..dc1e2e4dd5 100644 --- a/frontend/src/entry.client.tsx +++ b/frontend/src/entry.client.tsx @@ -25,7 +25,7 @@ function PosthogInit() { try { const config = await OptionService.getConfig(); setPosthogClientKey(config.POSTHOG_CLIENT_KEY); - } catch (error) { + } catch { displayErrorToast("Error fetching PostHog client key"); } })(); diff --git a/frontend/src/hooks/use-conversation-name-context-menu.ts b/frontend/src/hooks/use-conversation-name-context-menu.ts index ea39c0cb54..d286410d28 100644 --- a/frontend/src/hooks/use-conversation-name-context-menu.ts +++ b/frontend/src/hooks/use-conversation-name-context-menu.ts @@ -140,7 +140,7 @@ export function useConversationNameContextMenu({ } } // VS Code URL not available - } catch (error) { + } catch { // Failed to fetch VS Code URL } } diff --git a/frontend/src/utils/vscode-url-helper.ts b/frontend/src/utils/vscode-url-helper.ts index 5c81a360b9..21f32a66a8 100644 --- a/frontend/src/utils/vscode-url-helper.ts +++ b/frontend/src/utils/vscode-url-helper.ts @@ -24,7 +24,7 @@ export function transformVSCodeUrl(vsCodeUrl: string | null): string | null { } return vsCodeUrl; - } catch (error) { + } catch { // Silently handle the error and return the original URL return vsCodeUrl; }