From 827bd6701bdd89f577ff848442e4dfd07499fe0d Mon Sep 17 00:00:00 2001 From: Christian Kreuzberger Date: Thu, 21 Nov 2019 08:58:13 +0100 Subject: [PATCH] #1059 avoid calling .Fatal when logging non-fatal errors --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index aae207c..5971625 100644 --- a/main.go +++ b/main.go @@ -110,7 +110,8 @@ func retrieveMetrics(event cloudevents.Event) error { customQueries, err := getGlobalCustomQueries(kubeClient, stdLogger) if err != nil { - log.Fatal(err) + stdLogger.Error("Failed to get global custom queries") + stdLogger.Error(err.Error()) return err } @@ -118,7 +119,8 @@ func retrieveMetrics(event cloudevents.Event) error { projectCustomQueries, err := getCustomQueriesForProject(eventData.Project, kubeClient, stdLogger) if err != nil { - log.Fatal(err) + stdLogger.Error("Failed to get custom queries for project " + eventData.Project) + stdLogger.Error(err.Error()) return err }