Co-Authored-By: Claude Haiku 4.5 <[email protected]>
8 lines
195 B
TypeScript
8 lines
195 B
TypeScript
export function getErrorMessage(error: unknown, fallback: string): string {
|
|
if (error instanceof Error && error.message.trim().length > 0) {
|
|
return error.message;
|
|
}
|
|
|
|
return fallback;
|
|
}
|