mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
11 lines
219 B
TypeScript
11 lines
219 B
TypeScript
/**
|
|
* Convert unknown thrown values into a user-safe error string.
|
|
*/
|
|
export function getErrorMessage(error: unknown): string {
|
|
if (error instanceof Error) {
|
|
return error.message;
|
|
}
|
|
|
|
return String(error);
|
|
}
|