Skip to content

Commit

Permalink
Rename strictMode to strict
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenepaniot committed Oct 4, 2022
1 parent 6321d50 commit 2b88e11
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions pkg/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2b88e11

Please sign in to comment.