Refactor config to return an error instead of aborting

This commit is contained in:
Eric Meyer
2017-11-09 12:41:02 -06:00
parent 61cf7af2ec
commit aa52088ba7
8 changed files with 60 additions and 24 deletions
+4 -1
View File
@@ -18,7 +18,10 @@ import (
func main() {
environment := flag.String("environment", "", "Environment name")
flag.Parse()
cfg := config.NewConfig(*environment)
cfg, err := config.NewConfig(*environment)
if err != nil {
log.Fatalf("Error loading config\n%v", err)
}
fmt.Println("Client Path ", cfg.Client.IPCPath)
blockchain := geth.NewGethBlockchain(cfg.Client.IPCPath)