Skip to content

Commit

Permalink
fix: print error message along with non-zero exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko committed Jun 11, 2024
1 parent 3e6a227 commit 5bed7b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions call.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,13 @@ func runCall(cmd *cobra.Command, call *callArgs) error {
for i := 0; i < call.loop; i++ {
Log("Calling", funcName)
exit, res, err := globalPlugin.CallWithContext(ctx, funcName, input)
if exit != 0 {
return errors.New(fmt.Sprintf("Returned non-zero exit code: %d", exit))
}
if err != nil {
if exit == sys.ExitCodeDeadlineExceeded {
return errors.New("timeout")
} else if exit != 0 {
return errors.Join(err, errors.New(fmt.Sprintf("Returned non-zero exit code: %d", exit)))
}

return err
}
Log("Call returned", len(res), "bytes")
Expand Down

0 comments on commit 5bed7b4

Please sign in to comment.