Skip to content

Commit

Permalink
Errors weren't properly silenced
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Sep 19, 2020
1 parent 674683b commit e3e7d28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MDNSServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,16 +488,16 @@ export class MDNSServer {
// they happen when the host is not reachable (EADDRNOTAVAIL for 224.0.0.251 or EHOSTDOWN for any unicast traffic)
// caused by yet undetected network changes.
// as we listen to 0.0.0.0 and the socket stays valid, this is not a problem
const silenced = error.name === "EADDRNOTAVAIL" || error.name === "EHOSTDOWN" || error.name === "ENETUNREACH";
const silenced = error.message.includes("EADDRNOTAVAIL") || error.message.includes("EHOSTDOWN")
|| error.message.includes("ENETUNREACH") || error.message.includes("EHOSTUNREACH");
if (silenced) {
debug ("Silenced and ignored error (This is/should not be a problem, this message is only for informational purposes): " + error.message);
}
return silenced;
}

private static logSocketError(name: InterfaceName, error: Error): void {
console.warn(`Encountered MDNS socket error on socket '${name}' : ${error.message}`);
console.warn(error.stack);
console.warn(`Encountered MDNS socket error on socket '${name}' : ${error.stack}`);
return;
}

Expand Down

0 comments on commit e3e7d28

Please sign in to comment.