From d88af5f6e92f6ebffb132c53770ca21c347ea204 Mon Sep 17 00:00:00 2001 From: Shivang Shandilya <101946115+ShivangShandilya@users.noreply.github.com> Date: Tue, 11 Apr 2023 15:21:32 +0530 Subject: [PATCH] Update main.go Signed-off-by: Shivang Shandilya <101946115+ShivangShandilya@users.noreply.github.com> --- cmd/main.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 4965ad64..30288d6d 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -30,9 +30,8 @@ func main() { result, err := apinighthawk.NighthawkRun(testConfig) if err != nil { - msg := "Failed to run load-test" - err = errors.Wrapf(err, msg) - log.Fatal(err) + log.Error("Failed to run load test: ", err) + return } var result1 periodic.RunnerResults @@ -40,16 +39,16 @@ func main() { err = json.Unmarshal(result, &result1) if err != nil { - err = errors.Wrap(err, "Error while unmarshaling Nighthawk results to the FortioHTTPRunner") - log.Fatal(err) + log.Error("Error while unmarshaling Nighthawk results to the FortioHTTPRunner: ", err) + return } resultsMap := map[string]interface{}{} err = json.Unmarshal(result, &resultsMap) if err != nil { - err = errors.Wrap(err, "Error while unmarshaling Nighthawk results to map") - log.Fatal(err) + log.Error("Error while unmarshaling Nighthawk results to map: ", err) + return } log.Infof("Mapped version of the test: %+#v", resultsMap)