refactor: centralize unhandled rejection setup
This commit is contained in:
7
src/infra/bonjour-errors.ts
Normal file
7
src/infra/bonjour-errors.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function formatBonjourError(err: unknown): string {
|
||||
if (err instanceof Error) {
|
||||
const msg = err.message || String(err);
|
||||
return err.name && err.name !== "Error" ? `${err.name}: ${msg}` : msg;
|
||||
}
|
||||
return String(err);
|
||||
}
|
||||
Reference in New Issue
Block a user