mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 14:01:24 +08:00
9 lines
309 B
JavaScript
9 lines
309 B
JavaScript
// Small error formatting helper for scripts that accept unknown thrown values.
|
|
/** Return a readable message for Error and non-Error thrown values. */
|
|
export function formatErrorMessage(error) {
|
|
if (error instanceof Error) {
|
|
return error.message || error.name || "Error";
|
|
}
|
|
return String(error);
|
|
}
|