9089d017b6
Improve mobile bottom navigation, accessible dialogs and cards, explicit sync conflict resolution, i18n error messages, encrypted draft autosave, and persistent storage hints for offline data safety. Co-authored-by: Cursor <cursoragent@cursor.com>
11 lines
314 B
TypeScript
11 lines
314 B
TypeScript
/** Map unknown errors to a user-facing message (i18n key or fallback). */
|
|
export function getErrorMessage(err: unknown, fallback: string): string {
|
|
if (err instanceof Error && err.message.trim()) {
|
|
return err.message
|
|
}
|
|
if (typeof err === 'string' && err.trim()) {
|
|
return err
|
|
}
|
|
return fallback
|
|
}
|