From c5e9b9a2b9d3a677e624230b6dda070503f06d25 Mon Sep 17 00:00:00 2001 From: Ayush Kumar Date: Tue, 10 Jun 2025 18:20:56 +0530 Subject: [PATCH] fix: updates the error check on custom tasks to fail on errors for workflow run --- pkg/tasks/custom/task.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tasks/custom/task.go b/pkg/tasks/custom/task.go index 09df92c..2af1d84 100644 --- a/pkg/tasks/custom/task.go +++ b/pkg/tasks/custom/task.go @@ -192,7 +192,7 @@ func (t *TaskLoader) makeTaskGenerator(templ string) (types.TaskGenerator, error } for _, hook := range options.PostStopHooks { if err := hook(wfCtx, taskv, wfStep, exec.status(), options.StepStatus); err != nil { - exec.wfStatus.Message = err.Error() + exec.err(wfCtx, false, errors.Wrapf(err, "post-stop hook failed for step '%s': %v", wfStep.Name, err), types.StatusReasonOutput) stepStatus = exec.status() operations = exec.operation() return