From 2d6ed51d9407c2f6d8c065478d536ec3a019dade Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 3 Oct 2016 09:22:59 +0200 Subject: Bail out on samechannel gateway when a bridge fails to start --- gateway/samechannel/samechannel.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gateway/samechannel') diff --git a/gateway/samechannel/samechannel.go b/gateway/samechannel/samechannel.go index 1ed43750..c7b3d624 100644 --- a/gateway/samechannel/samechannel.go +++ b/gateway/samechannel/samechannel.go @@ -29,7 +29,10 @@ func New(cfg *config.Config, gateway *config.SameChannelGateway) error { gw.Bridges = append(gw.Bridges, bridge.New(cfg, &br, c)) } for _, br := range gw.Bridges { - br.Connect() + err := br.Connect() + if err != nil { + log.Fatalf("Bridge %s failed to start: %v", br.FullOrigin(), err) + } for _, channel := range gw.Channels { log.Infof("%s: joining %s", br.FullOrigin(), channel) br.JoinChannel(channel) -- cgit v1.2.3