mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-15 06:12:50 -07:00
Unused error variables in catch block are not allowed (#24487)
This commit is contained in:
@@ -195,7 +195,7 @@ function doesVersionExist({ args, version } = {}) {
|
||||
console.error(`Version ${version} already exists on NPM.`);
|
||||
return true;
|
||||
}
|
||||
} catch (_error) {
|
||||
} catch {
|
||||
// This is expected if the version doesn't exist.
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -177,7 +177,7 @@ function runCommand(command, stdio = 'inherit') {
|
||||
].join(sep);
|
||||
execSync(command, { stdio, env, shell: true });
|
||||
return true;
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -267,7 +267,7 @@ export function runSensitiveKeywordLinter() {
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(Boolean);
|
||||
} catch (_error) {
|
||||
} catch {
|
||||
console.error(`Could not get changed files against origin/${baseRef}.`);
|
||||
try {
|
||||
console.log('Falling back to diff against HEAD~1');
|
||||
@@ -276,7 +276,7 @@ export function runSensitiveKeywordLinter() {
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(Boolean);
|
||||
} catch (_fallbackError) {
|
||||
} catch {
|
||||
console.error('Could not get changed files against HEAD~1 either.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -105,11 +105,11 @@ async function main() {
|
||||
try {
|
||||
execSync('pkill -f "otelcol-contrib"');
|
||||
console.log('✅ Stopped existing otelcol-contrib process.');
|
||||
} catch (_e) {} // eslint-disable-line no-empty
|
||||
} catch {} // eslint-disable-line no-empty
|
||||
try {
|
||||
execSync('pkill -f "jaeger"');
|
||||
console.log('✅ Stopped existing jaeger process.');
|
||||
} catch (_e) {} // eslint-disable-line no-empty
|
||||
} catch {} // eslint-disable-line no-empty
|
||||
try {
|
||||
if (fileExists(OTEL_LOG_FILE)) fs.unlinkSync(OTEL_LOG_FILE);
|
||||
console.log('✅ Deleted old collector log.');
|
||||
@@ -155,7 +155,7 @@ async function main() {
|
||||
try {
|
||||
await waitForPort(JAEGER_PORT);
|
||||
console.log(`✅ Jaeger started successfully.`);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
console.error(`🛑 Error: Jaeger failed to start on port ${JAEGER_PORT}.`);
|
||||
if (jaegerProcess && jaegerProcess.pid) {
|
||||
process.kill(jaegerProcess.pid, 'SIGKILL');
|
||||
@@ -180,7 +180,7 @@ async function main() {
|
||||
try {
|
||||
await waitForPort(4317);
|
||||
console.log(`✅ OTEL collector started successfully.`);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
console.error(`🛑 Error: OTEL collector failed to start on port 4317.`);
|
||||
if (collectorProcess && collectorProcess.pid) {
|
||||
process.kill(collectorProcess.pid, 'SIGKILL');
|
||||
|
||||
@@ -180,7 +180,7 @@ async function main() {
|
||||
// Re-throw if it's not a conflict error
|
||||
throw error;
|
||||
}
|
||||
} catch (_statusError) {
|
||||
} catch {
|
||||
// Re-throw original error if we can't determine the status
|
||||
throw error;
|
||||
}
|
||||
@@ -268,7 +268,7 @@ function branchExists(branchName) {
|
||||
try {
|
||||
execSync(`git ls-remote --exit-code --heads origin ${branchName}`);
|
||||
return true;
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ No output was generated during patch creation.
|
||||
// Clean up temp file
|
||||
try {
|
||||
unlinkSync(tmpFile);
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
// Ignore cleanup errors
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ function runCommand(command) {
|
||||
stdio: ['ignore', 'pipe', 'ignore'],
|
||||
maxBuffer: 10 * 1024 * 1024,
|
||||
});
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ async function main() {
|
||||
try {
|
||||
execSync('pkill -f "otelcol-contrib"');
|
||||
console.log('✅ Stopped existing otelcol-contrib process.');
|
||||
} catch (_e) {
|
||||
} catch {
|
||||
/* no-op */
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -438,7 +438,7 @@ export function registerCleanup(
|
||||
if (fd) {
|
||||
try {
|
||||
fs.closeSync(fd);
|
||||
} catch (_) {
|
||||
} catch {
|
||||
/* no-op */
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user