mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
refactor: dedupe script error formatting
This commit is contained in:
6
scripts/lib/error-format.mjs
Normal file
6
scripts/lib/error-format.mjs
Normal file
@@ -0,0 +1,6 @@
|
||||
export function formatErrorMessage(error) {
|
||||
if (error instanceof Error) {
|
||||
return error.message || error.name || "Error";
|
||||
}
|
||||
return String(error);
|
||||
}
|
||||
Reference in New Issue
Block a user