mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 07:10:55 +00:00
Run npm run format
- This has the entirety of the changes. Part of https://b.corp.google.com/issues/411720532
This commit is contained in:
parent
fa264e4286
commit
383b917784
26 changed files with 211 additions and 208 deletions
|
|
@ -1,18 +1,18 @@
|
|||
export function isNodeError(error: unknown): error is NodeJS.ErrnoException {
|
||||
return error instanceof Error && 'code' in error;
|
||||
return error instanceof Error && 'code' in error;
|
||||
}
|
||||
|
||||
export function getErrorMessage(error: unknown): string {
|
||||
if (error instanceof Error) {
|
||||
return error.message;
|
||||
} else {
|
||||
// Attempt to convert the non-Error value to a string for logging
|
||||
try {
|
||||
const errorMessage = String(error);
|
||||
return errorMessage;
|
||||
} catch {
|
||||
// If String() itself fails (highly unlikely)
|
||||
return 'Failed to get error details';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (error instanceof Error) {
|
||||
return error.message;
|
||||
} else {
|
||||
// Attempt to convert the non-Error value to a string for logging
|
||||
try {
|
||||
const errorMessage = String(error);
|
||||
return errorMessage;
|
||||
} catch {
|
||||
// If String() itself fails (highly unlikely)
|
||||
return 'Failed to get error details';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue