Skip to content

Commit

Permalink
Fix error handling when aborting a workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell committed Dec 16, 2024
1 parent a005c5d commit bd269d8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion workflow/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,13 @@ func (e *executableWorkflow) Execute(ctx context.Context, serializedInput any) (
return "", nil, lastErrors
case <-timedContext.Done():
lastErrors := l.handleErrors()
return "", nil, fmt.Errorf("workflow execution aborted (%w) (%s)", ctx.Err(), lastErrors.Error())
var errMsg string
if lastErrors == nil {
errMsg = ""
} else {
errMsg = lastErrors.Error()
}
return "", nil, fmt.Errorf("workflow execution aborted (%w) (%s)", ctx.Err(), errMsg)
}

}
Expand Down

0 comments on commit bd269d8

Please sign in to comment.