mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 02:24:09 -07:00
Unused error variables in catch block are not allowed (#24487)
This commit is contained in:
@@ -1817,7 +1817,7 @@ export async function connectToMcpServer(
|
||||
await mcpClient.notification({
|
||||
method: 'notifications/roots/list_changed',
|
||||
});
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// If this fails, its almost certainly because the connection was closed
|
||||
// and we should just stop listening for future directory changes.
|
||||
unlistenDirectories?.();
|
||||
|
||||
@@ -830,7 +830,7 @@ describe('DiscoveredMCPTool', () => {
|
||||
if (expectError) {
|
||||
try {
|
||||
await invocation.execute(controller.signal);
|
||||
} catch (_error) {
|
||||
} catch {
|
||||
// Expected error
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -678,7 +678,7 @@ describe('RipGrepTool', () => {
|
||||
stdout.write(match + '\n');
|
||||
linesPushed++;
|
||||
}
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
clearInterval(pushInterval);
|
||||
}
|
||||
}, 1);
|
||||
|
||||
@@ -749,7 +749,7 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
||||
) {
|
||||
currentPath = path.dirname(currentPath);
|
||||
}
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
while (currentPath.length > 1) {
|
||||
@@ -770,7 +770,7 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
||||
}
|
||||
currentPath = path.dirname(currentPath);
|
||||
}
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ export abstract class BaseToolInvocation<
|
||||
|
||||
try {
|
||||
void this.messageBus.publish(request);
|
||||
} catch (_error) {
|
||||
} catch {
|
||||
cleanup();
|
||||
resolve('allow');
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ function checkRateLimit(url: string): {
|
||||
history.push(now);
|
||||
hostRequestHistory.set(hostname, history);
|
||||
return { allowed: true };
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
// If URL parsing fails, we fallback to allowed (should be caught by parsePrompt anyway)
|
||||
return { allowed: true };
|
||||
}
|
||||
@@ -132,7 +132,7 @@ export function parsePrompt(text: string): {
|
||||
`Unsupported protocol in URL: "${token}". Only http and https are supported.`,
|
||||
);
|
||||
}
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// new URL() threw, so it's malformed according to WHATWG standard
|
||||
errors.push(`Malformed URL detected: "${token}".`);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ export class XcodeMcpBridgeFixTransport
|
||||
// If successful, populate structuredContent
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
result.structuredContent = parsed;
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// Ignored: Content is likely plain text, not JSON.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user