mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-26 17:32:16 +00:00
12 lines
362 B
TypeScript
12 lines
362 B
TypeScript
export function formatBonjourError(err: unknown): string {
|
|
if (err instanceof Error) {
|
|
const trimmedMessage = err.message.trim();
|
|
const msg = trimmedMessage || err.name || String(err).trim();
|
|
if (err.name && err.name !== "Error") {
|
|
return msg === err.name ? err.name : `${err.name}: ${msg}`;
|
|
}
|
|
return msg;
|
|
}
|
|
return String(err);
|
|
}
|