mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 11:04:42 -07:00
Unused error variables in catch block are not allowed (#24487)
This commit is contained in:
@@ -159,7 +159,7 @@ export function parseGoogleApiError(error: unknown): GoogleApiError | null {
|
||||
if (typeof errorObj === 'string') {
|
||||
try {
|
||||
errorObj = JSON.parse(sanitizeJsonString(errorObj));
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// Not a JSON string, can't parse.
|
||||
return null;
|
||||
}
|
||||
@@ -200,7 +200,7 @@ export function parseGoogleApiError(error: unknown): GoogleApiError | null {
|
||||
// The message is a JSON string, but not a nested error object.
|
||||
break;
|
||||
}
|
||||
} catch (_error) {
|
||||
} catch {
|
||||
// It wasn't a JSON string, so we've drilled down as far as we can.
|
||||
break;
|
||||
}
|
||||
@@ -284,7 +284,7 @@ function fromGaxiosError(errorObj: object): ErrorShape | undefined {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
data = JSON.parse(sanitizeJsonString(data));
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// Not a JSON string, can't parse.
|
||||
}
|
||||
}
|
||||
@@ -334,7 +334,7 @@ function fromApiError(errorObj: object): ErrorShape | undefined {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
data = JSON.parse(sanitizeJsonString(data));
|
||||
} catch (_) {
|
||||
} catch {
|
||||
// Not a JSON string, can't parse.
|
||||
// Try one more fallback: look for the first '{' and last '}'
|
||||
if (typeof data === 'string') {
|
||||
@@ -346,7 +346,7 @@ function fromApiError(errorObj: object): ErrorShape | undefined {
|
||||
data = JSON.parse(
|
||||
sanitizeJsonString(data.substring(firstBrace, lastBrace + 1)),
|
||||
);
|
||||
} catch (__) {
|
||||
} catch {
|
||||
// Still failed
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user