diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-26 20:09:11 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-01-26 20:09:11 +0900 |
commit | 1a36b97d46e3a6958c1646398c5354ef74bea24b (patch) | |
tree | 0c00f427db56c49be1ddd37176717b047ef0802b | |
parent | 7925a63bc54536b0a39ed72666cd49d1c0cbddc2 (diff) |
config: make config file failure Fatal
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | config/serve.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/config/serve.go b/config/serve.go index 23e4c1de..02eb2e6e 100644 --- a/config/serve.go +++ b/config/serve.go @@ -2,6 +2,7 @@ package config import ( "github.com/BurntSushi/toml" + log "github.com/Sirupsen/logrus" ) func ReadConfigfileServe(path string, configCh chan BgpType, reloadCh chan bool) { @@ -10,7 +11,9 @@ func ReadConfigfileServe(path string, configCh chan BgpType, reloadCh chan bool) b := BgpType{} _, err := toml.DecodeFile(path, &b) - if err == nil { + if err != nil { + log.Fatal("can't read config file ", path) + } else { // TODO: validate configuration for i, _ := range b.NeighborList { SetNeighborTypeDefault(&b.NeighborList[i]) |