mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-03 16:34:31 -07:00
fix(core): improve error type extraction for telemetry (#19565)
Co-authored-by: Yuna Seol <yunaseol@google.com>
This commit is contained in:
@@ -26,6 +26,15 @@ export function getErrorMessage(error: unknown): string {
|
||||
}
|
||||
}
|
||||
|
||||
export function getErrorType(error: unknown): string {
|
||||
if (!(error instanceof Error)) return 'unknown';
|
||||
|
||||
// Return constructor name if the generic 'Error' name is used (for custom errors)
|
||||
return error.name === 'Error'
|
||||
? (error.constructor?.name ?? 'Error')
|
||||
: error.name;
|
||||
}
|
||||
|
||||
export class FatalError extends Error {
|
||||
constructor(
|
||||
message: string,
|
||||
|
||||
Reference in New Issue
Block a user