Fail gracefully on incorrect human input. Fixes #739 (#740)

This commit is contained in:
Wim 2019-02-26 18:03:50 +01:00 committed by GitHub
parent d8816280f0
commit 7f1d86b338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,6 +92,9 @@ func (gw *Gateway) AddBridge(cfg *config.Bridge) error {
Bridge: br, Bridge: br,
} }
// add the actual bridger for this protocol to this bridge using the bridgeMap // add the actual bridger for this protocol to this bridge using the bridgeMap
if _, ok := gw.Router.BridgeMap[br.Protocol]; !ok {
gw.logger.Fatalf("Incorrect protocol %s specified in gateway configuration %s, exiting.", br.Protocol, cfg.Account)
}
br.Bridger = gw.Router.BridgeMap[br.Protocol](brconfig) br.Bridger = gw.Router.BridgeMap[br.Protocol](brconfig)
} }
gw.mapChannelsToBridge(br) gw.mapChannelsToBridge(br)