From 521cf4e8c9ddfefa96e8a169804a79fe1aa352db Mon Sep 17 00:00:00 2001 From: epipho Date: Sat, 18 Oct 2014 22:26:29 -0400 Subject: [PATCH] Exit app if config cannot be read correctly --- server/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/main.go b/server/main.go index 2fb4115a..abdbc678 100644 --- a/server/main.go +++ b/server/main.go @@ -5,6 +5,7 @@ import ( "flag" "fmt" "net/http" + "os" "strings" "github.com/drone/config" @@ -83,7 +84,11 @@ func main() { // Parses config data. The config data can be stored in a config // file (.toml format) or environment variables, or a combo. config.SetPrefix("DRONE_") - config.Parse(conf) + err := config.Parse(conf) + if err != nil { + log.Errf("Unable to parse config: %v", err) + os.Exit(1) + } // Setup the remote services. We need to execute these to register // the remote plugins with the system.