Skip to content

Commit

Permalink
Fix error handling when aborting a workflow (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell authored Dec 16, 2024
1 parent a005c5d commit 1b7c942
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 1b7c942

Please sign in to comment.