Skip to content

Commit

Permalink
S-109616 Remove redundant error message (#59)
Browse files Browse the repository at this point in the history
* S-109616 Remove redundant error message

* S-109616 Fix tests

* S-109616 Revert deserialization message
  • Loading branch information
jberta-agency04 committed May 7, 2024
1 parent 6278bb7 commit 95c44a9
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion runner/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func execute(pluginVersion string, buildDate string, runner Runner) {
task.HandleAbort(resultMap)
default:
klog.Errorf("Failed executing runner function %v", err)
task.HandleError(fmt.Errorf("failed to execute run function: %v", err), resultMap, records)
task.HandleError(err, resultMap, records)
}
return
}
Expand Down
2 changes: 1 addition & 1 deletion runner/test/testdata/command_fail/expected.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"exitCode":-1,"outputProperties":{"errorMessage":"simulate error"},"jobErrorMessage":"failed to execute run function: simulate error","reportingRecords":[]}
{"exitCode":-1,"outputProperties":{"errorMessage":"simulate error"},"jobErrorMessage":"simulate error","reportingRecords":[]}
2 changes: 1 addition & 1 deletion runner/test/testdata/fail/expected.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"exitCode":-1,"outputProperties":{"errorMessage":"this simulates an error"},"jobErrorMessage":"failed to execute run function: this simulates an error","reportingRecords":[]}
{"exitCode":-1,"outputProperties":{"errorMessage":"this simulates an error"},"jobErrorMessage":"this simulates an error","reportingRecords":[]}
2 changes: 1 addition & 1 deletion runner/test/testdata/no_such_command/expected.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"exitCode":-1,"outputProperties":{"errorMessage":"cannot deserialize input: cannot find command type"},"jobErrorMessage":"failed to execute run function: cannot deserialize input: cannot find command type","reportingRecords":[]}
{"exitCode":-1,"outputProperties":{"errorMessage":"cannot deserialize input: cannot find command type"},"jobErrorMessage":"cannot deserialize input: cannot find command type","reportingRecords":[]}
2 changes: 1 addition & 1 deletion runner/test/testdata/process_bool_error/expected.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"exitCode":-1,"jobErrorMessage":"failed to execute run function: error evaluating 'the-json-bool' field value: strconv.ParseBool: parsing \"\\\"2022-09-16T11:35:02Z\\\"\": invalid syntax","reportingRecords":[]}
{"exitCode":-1,"jobErrorMessage":"error evaluating 'the-json-bool' field value: strconv.ParseBool: parsing \"\\\"2022-09-16T11:35:02Z\\\"\": invalid syntax","reportingRecords":[]}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"exitCode":-1,"jobErrorMessage":"failed to execute run function: error evaluating 'the-json-date' field value: error parsing date: parsing time \"2022-09-16T11:35:02Z\": extra text: \"Z\"","reportingRecords":[]}
{"exitCode":-1,"jobErrorMessage":"error evaluating 'the-json-date' field value: error parsing date: parsing time \"2022-09-16T11:35:02Z\": extra text: \"Z\"","reportingRecords":[]}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"exitCode":-1,"jobErrorMessage":"failed to execute run function: error evaluating 'the-json' field value: could not apply parser for JQ operation '.metadata.label': key not found","reportingRecords":[]}
{"exitCode":-1,"jobErrorMessage":"error evaluating 'the-json' field value: could not apply parser for JQ operation '.metadata.label': key not found","reportingRecords":[]}

0 comments on commit 95c44a9

Please sign in to comment.