← Public packages
@kentcdodds/package-app-kit
Design tokens, PWA install/update, About/version, cache helpers, and optional realtime notes sync for Kody package apps.
starter-remix/app/ui/to-error-message.ts
9 lines · 269 B · TypeScriptexport function toErrorMessage(error: unknown): string {
if (error instanceof Error && error.message) return error.message
if (typeof error === 'string' && error.trim()) return error.trim()
try {
return JSON.stringify(error)
} catch {
return String(error)
}
}