summaryrefslogtreecommitdiffstats
path: root/gateway
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-10-03 09:22:59 +0200
committerWim <wim@42.be>2016-10-03 09:23:55 +0200
commit2d6ed51d9407c2f6d8c065478d536ec3a019dade (patch)
treeb602634f44079bdc8cc84a95756ee89269c7d9f9 /gateway
parent9ca4fe7a5e928d509ecf3fd03e9d7f003783b305 (diff)
downloadmatterbridge-msglm-2d6ed51d9407c2f6d8c065478d536ec3a019dade.tar.gz
matterbridge-msglm-2d6ed51d9407c2f6d8c065478d536ec3a019dade.tar.bz2
matterbridge-msglm-2d6ed51d9407c2f6d8c065478d536ec3a019dade.zip
Bail out on samechannel gateway when a bridge fails to start
Diffstat (limited to 'gateway')
-rw-r--r--gateway/gateway.go2
-rw-r--r--gateway/samechannel/samechannel.go5
2 files changed, 5 insertions, 2 deletions
diff --git a/gateway/gateway.go b/gateway/gateway.go
index 2180f930..fefbaeb2 100644
--- a/gateway/gateway.go
+++ b/gateway/gateway.go
@@ -38,7 +38,7 @@ func New(cfg *config.Config, gateway *config.Gateway) error {
for _, br := range gw.Bridges {
err := br.Connect()
if err != nil {
- log.Fatalf("Bridge %s failed to start. Exiting", br.FullOrigin())
+ log.Fatalf("Bridge %s failed to start: %v", br.FullOrigin(), err)
}
for _, channel := range append(gw.ChannelsOut[br.FullOrigin()], gw.ChannelsIn[br.FullOrigin()]...) {
if exists[br.FullOrigin()+channel] {
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)