From 1d550ef24d760535d4469e19963e897fa63da43d Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Mon, 2 Dec 2019 11:25:50 +0100 Subject: Improve error handing when creating new domains config source --- app.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app.go') diff --git a/app.go b/app.go index eeefaeaf..90b6320d 100644 --- a/app.go +++ b/app.go @@ -413,9 +413,14 @@ func (a *theApp) listenMetricsFD(wg *sync.WaitGroup, fd uintptr) { } func runApp(config appConfig) { - a := theApp{appConfig: config, domains: source.NewDomains(config)} + domains, err := source.NewDomains(config) + if err != nil { + log.WithError(err).Fatal("could not create domains config source") + } + + a := theApp{appConfig: config, domains: domains} - err := logging.ConfigureLogging(a.LogFormat, a.LogVerbose) + err = logging.ConfigureLogging(a.LogFormat, a.LogVerbose) if err != nil { log.WithError(err).Fatal("Failed to initialize logging") } -- cgit v1.2.3