Preserve batch cancellation outcomes

This commit is contained in:
2026-08-13 03:02:59 +00:00
parent 4b748c2e53
commit 70cad789ea
11 changed files with 207 additions and 17 deletions

View File

@@ -111,12 +111,15 @@ func (r Runner) Run(ctx context.Context, args []string, stdout io.Writer, stderr
}
result, err := runBatchDetailed(ctx, req)
if result != nil {
summary := newBatchSummary(result)
summary := newBatchSummary(result, err)
if encodeErr := writeActionResult(stdout, stderr, summary, outputOptions{Quiet: opts.Quiet}, func(w io.Writer) {
writeBatchStatus(w, result)
}); encodeErr != nil {
return encodeErr
}
if err != nil {
return err
}
if summary.Status == summaryStatusFailed {
return app.BatchError{Result: result}
}