Restore cancellation checks before report delivery
This commit is contained in:
@@ -94,18 +94,13 @@ func runConfigExplanation[I, S any](invocation commandkit.Invocation, plan *conf
|
||||
}
|
||||
return commandkit.Success()
|
||||
}
|
||||
err := reporter.RenderOutput(func(writer io.Writer) error {
|
||||
return renderPreparedConfigReport(invocation, acquired.Explanation, func() ([]byte, error) {
|
||||
var report bytes.Buffer
|
||||
if err := encodeYAML(&report, makeExplanationReport(name, explanation)); err != nil {
|
||||
return err
|
||||
return nil, err
|
||||
}
|
||||
_, err := writer.Write(report.Bytes())
|
||||
return err
|
||||
return report.Bytes(), nil
|
||||
})
|
||||
if err != nil && invocation.Context.Err() != nil {
|
||||
return configFailure("Configuration explanation was canceled.", acquired.Explanation, invocation.Context.Err())
|
||||
}
|
||||
return commandkit.Success()
|
||||
}
|
||||
|
||||
func makeExplanationReport(scope string, explanation configkit.Explanation) explanationReport {
|
||||
|
||||
Reference in New Issue
Block a user