Unused error variables in catch block are not allowed (#24487)

This commit is contained in:
Alisa
2026-04-01 21:33:07 -07:00
committed by GitHub
parent 84936dc85d
commit 3344f6849c
92 changed files with 162 additions and 157 deletions

View File

@@ -319,7 +319,7 @@ export function useAtCompletion(props: UseAtCompletionProps): void {
if (state.pattern !== null) {
dispatch({ type: 'SEARCH', payload: state.pattern });
}
} catch (_) {
} catch {
if (initEpoch.current === currentEpoch) {
dispatch({ type: 'ERROR' });
}

View File

@@ -51,7 +51,7 @@ describe('useConsoleMessages', () => {
for (const unmount of unmounts) {
try {
unmount();
} catch (_e) {
} catch {
// Ignore unmount errors
}
}
@@ -161,7 +161,7 @@ describe('useErrorCount', () => {
for (const unmount of unmounts) {
try {
unmount();
} catch (_e) {
} catch {
// Ignore unmount errors
}
}

View File

@@ -102,7 +102,7 @@ export const useFolderTrust = (
try {
await trustedFolders.setValue(cwd, trustLevel);
} catch (_e) {
} catch {
coreEvents.emitFeedback(
'error',
'Failed to save trust settings. Exiting Gemini CLI.',

View File

@@ -31,7 +31,7 @@ export function useGitBranchName(cwd: string): string | undefined {
);
setBranchName(hashStdout.toString().trim());
}
} catch (_error) {
} catch {
setBranchName(undefined);
}
}, [cwd, setBranchName]);
@@ -57,7 +57,7 @@ export function useGitBranchName(cwd: string): string | undefined {
fetchBranchName();
}
});
} catch (_watchError) {
} catch {
// Silently ignore watcher errors (e.g. permissions or file not existing),
// similar to how exec errors are handled.
// The branch name will simply not update automatically.

View File

@@ -141,7 +141,7 @@ export const usePermissionsModifyTrust = (
const folders = loadTrustedFolders();
try {
await folders.setValue(cwd, trustLevel);
} catch (_e) {
} catch {
coreEvents.emitFeedback(
'error',
'Failed to save trust settings. Your changes may not persist.',
@@ -159,7 +159,7 @@ export const usePermissionsModifyTrust = (
try {
await folders.setValue(cwd, pendingTrustLevel);
return true;
} catch (_e) {
} catch {
coreEvents.emitFeedback(
'error',
'Failed to save trust settings. Your changes may not persist.',