From 31174db3fd43fab7b045b5f7c36ad6ef67c560c1 Mon Sep 17 00:00:00 2001 From: Heiko Rothe Date: Fri, 28 Feb 2020 12:53:54 +0100 Subject: [PATCH] fix(cluster): catch mdns discovery issues Closes #107 --- src/cluster/cluster.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cluster/cluster.service.ts b/src/cluster/cluster.service.ts index 11f1d1a..39379c1 100644 --- a/src/cluster/cluster.service.ts +++ b/src/cluster/cluster.service.ts @@ -76,7 +76,14 @@ export class ClusterService extends Democracy onApplicationBootstrap(): void { if (this.config.autoDiscovery) { if (mdns !== undefined) { - this.startBonjourDiscovery(); + try { + this.startBonjourDiscovery(); + } catch (e) { + this.logger.error( + `Failed to start mdns discovery (${e.message})`, + e.stack + ); + } } else { this.logger.warn( 'Dependency "mdns" was not found, automatic discovery has been disabled. You will have to provide the addresses of other room-assistant nodes manually in the config.'