Skip to content

Commit

Permalink
Return outputvars even when there is an error (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankushChatterjee authored Dec 6, 2024
1 parent 87f3402 commit f0b3790
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions command/harness/dlite/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,8 @@ func convert(r *api.PollStepResponse) VMTaskExecutionResponse {
if r.Error == "" {
return VMTaskExecutionResponse{CommandExecutionStatus: Success, OutputVars: r.Outputs, Artifact: r.Artifact, Outputs: r.OutputV2, OptimizationState: r.OptimizationState}
}
if r.OutputV2 != nil && len(r.OutputV2) > 0 {
return VMTaskExecutionResponse{CommandExecutionStatus: Failure, OutputVars: r.Outputs, Outputs: r.OutputV2, ErrorMessage: r.Error, OptimizationState: r.OptimizationState}
}
return VMTaskExecutionResponse{CommandExecutionStatus: Failure, ErrorMessage: r.Error, OptimizationState: r.OptimizationState}
}

0 comments on commit f0b3790

Please sign in to comment.