5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-24 18:25:40 +00:00

Fail with message instead of panic. #988 (#991)

This commit is contained in:
Wim 2020-02-01 15:23:50 +01:00 committed by GitHub
parent fc30b1bacc
commit 7486555875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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]