diff --git a/internal/framework/pipeline/runner_typed.go b/internal/framework/pipeline/runner_typed.go index 0a8fd6f9..f2f0f068 100644 --- a/internal/framework/pipeline/runner_typed.go +++ b/internal/framework/pipeline/runner_typed.go @@ -471,11 +471,11 @@ func setTypedLaneManifestMetadata(output *RunOutput, laneID string, extractor, m return nil } -func (r *Runner) validateTypedArtifact(ctx context.Context, codec artifactCodecEntry, target typedValidationTarget, chain preparedValidatorChain, attempt int, debug DebugRecorder) ([]contracts.Warning, *contracts.RejectedOutput, error) { +func (r *Runner) validateTypedReport(ctx context.Context, codec artifactCodecEntry, target typedValidationTarget, chain preparedValidatorChain, attempt int, debug DebugRecorder) (validationReport, error) { if len(chain.validators) > 0 && target.candidate == nil { candidate, err := validationCandidateArtifact(codec, target) if err != nil { - return nil, nil, fmt.Errorf("serialize %s candidate for validation: %w", target.stage, err) + return validationReport{}, fmt.Errorf("serialize %s candidate for validation: %w", target.stage, err) } target.candidate = &candidate } @@ -537,6 +537,14 @@ func (r *Runner) validateTypedArtifact(ctx context.Context, codec artifactCodecE } return validationInvocation{result: result}, nil }) + if err != nil { + return report, err + } + return report, nil +} + +func (r *Runner) validateTypedArtifact(ctx context.Context, codec artifactCodecEntry, target typedValidationTarget, chain preparedValidatorChain, attempt int, debug DebugRecorder) ([]contracts.Warning, *contracts.RejectedOutput, error) { + report, err := r.validateTypedReport(ctx, codec, target, chain, attempt, debug) if err != nil { return report.Warnings(), nil, err }