refactor: centralize unhandled rejection setup
This commit is contained in:
14
src/infra/bonjour-ciao.ts
Normal file
14
src/infra/bonjour-ciao.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { logDebug } from "../logger.js";
|
||||
|
||||
import { formatBonjourError } from "./bonjour-errors.js";
|
||||
|
||||
export function ignoreCiaoCancellationRejection(reason: unknown): boolean {
|
||||
const message = formatBonjourError(reason).toUpperCase();
|
||||
if (!message.includes("CIAO ANNOUNCEMENT CANCELLED")) {
|
||||
return false;
|
||||
}
|
||||
logDebug(
|
||||
`bonjour: ignoring unhandled ciao rejection: ${formatBonjourError(reason)}`,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user