Skip to content

Commit

Permalink
Fail with message instead of panic. #988
Browse files Browse the repository at this point in the history
  • Loading branch information
42wim committed Feb 1, 2020
1 parent fc30b1b commit def7428
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bridge/bridge.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package bridge

import (
"log"
"strings"
"sync"

Expand Down Expand Up @@ -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]

Expand Down

0 comments on commit def7428

Please sign in to comment.