From 748655587527875ea360822255a60a892b8c4953 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 1 Feb 2020 15:23:50 +0100 Subject: Fail with message instead of panic. #988 (#991) --- bridge/bridge.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bridge/bridge.go b/bridge/bridge.go index fdc1ec8b..5612e35d 100644 --- a/bridge/bridge.go +++ b/bridge/bridge.go @@ -1,6 +1,7 @@ package bridge import ( + "log" "strings" "sync" @@ -41,6 +42,10 @@ type Factory func(*Config) Bridger func New(bridge *config.Bridge) *Bridge { accInfo := strings.Split(bridge.Account, ".") + if len(accInfo) != 2 { + log.Fatalf("config failure, account incorrect: %s", bridge.Account) + } + protocol := accInfo[0] name := accInfo[1] -- cgit v1.2.3