Files
paradox-save-parser-frontend/src/lib/errors.ts
T
2026-09-13 23:50:59 +02:00

8 lines
251 B
TypeScript

/**
* Extracts a readable message from an unknown thrown value, since anything
* (not just an Error) can be thrown and caught.
*/
export function getMsgFromError(err: unknown): string {
return err instanceof Error ? err.message : String(err)
}