From 2b88e116aea5cfc6fce9d34434badd38ccf1cf77 Mon Sep 17 00:00:00 2001 From: Eugene Paniot Date: Tue, 4 Oct 2022 11:10:49 +0100 Subject: [PATCH] Rename strictMode to strict --- pkg/replay.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pkg/replay.go b/pkg/replay.go index e88d196..a04a051 100644 --- a/pkg/replay.go +++ b/pkg/replay.go @@ -27,7 +27,7 @@ import ( "time" ) -func Replay(phasesStr string, silent, dryRun bool, timeout int, strictMode bool) int { +func Replay(phasesStr string, silent, dryRun bool, timeout int, strict bool) int { // Default exit code var exitCode int = 0 // Ensures we have handled all HTTP request results before exiting @@ -58,20 +58,19 @@ func Replay(phasesStr string, silent, dryRun bool, timeout int, strictMode bool) for scanner.Scan() { req, err := unmarshalRequest(scanner.Bytes()) if err != nil { - if strictMode { + exitCode = 126 + result, _ := json.Marshal(Result{ + StatusCode: 0, + Latency: 0, + Request: req, + ErrorMsg: fmt.Sprintf("%v", err), + }) + fmt.Println(string(result)) + + if strict { panic(err) - } else { - exitCode = 126 - result, _ := json.Marshal(Result{ - StatusCode: 0, - Latency: 0, - Request: req, - ErrorMsg: fmt.Sprintf("%v", err), - }) - fmt.Println(string(result)) - - continue } + continue } if pacer.done {