From 1accee1653e35e50c4f68124d56ce5edc2c896c4 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 1 Oct 2016 20:07:04 +0200 Subject: Bail out when a bridge fails to start --- gateway/gateway.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gateway') diff --git a/gateway/gateway.go b/gateway/gateway.go index 18ded7cd..2180f930 100644 --- a/gateway/gateway.go +++ b/gateway/gateway.go @@ -36,7 +36,10 @@ func New(cfg *config.Config, gateway *config.Gateway) error { gw.mapIgnores() exists = make(map[string]bool) for _, br := range gw.Bridges { - br.Connect() + err := br.Connect() + if err != nil { + log.Fatalf("Bridge %s failed to start. Exiting", br.FullOrigin()) + } for _, channel := range append(gw.ChannelsOut[br.FullOrigin()], gw.ChannelsIn[br.FullOrigin()]...) { if exists[br.FullOrigin()+channel] { continue -- cgit v1.2.3