Skip to content

Commit

Permalink
Merge pull request #309 from cschleiden/remove-more-panics
Browse files Browse the repository at this point in the history
Remove remaining panics
  • Loading branch information
cschleiden committed Jan 21, 2024
2 parents 9fbfb31 + e961fa1 commit c5d50c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/worker/workflow.go
Expand Up @@ -78,7 +78,7 @@ func (wtw *WorkflowTaskWorker) Complete(ctx context.Context, result *workflow.Ex
if err := wtw.backend.CompleteWorkflowTask(
ctx, t, t.WorkflowInstance, state, result.Executed, result.ActivityEvents, result.TimerEvents, result.WorkflowEvents); err != nil {
wtw.logger.ErrorContext(ctx, "could not complete workflow task", "error", err)
panic("could not complete workflow task")
return fmt.Errorf("completing workflow task: %w", err)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/workflow/executor.go
Expand Up @@ -245,7 +245,7 @@ func (e *executor) replayHistory(h []*history.Event) error {
for _, event := range h {
if event.SequenceID < e.lastSequenceID {
e.logger.Error("history has older events than current state")
panic("history has older events than current state")
return errors.New("history has older events than current state")
}

if err := e.executeEvent(event); err != nil {
Expand Down

0 comments on commit c5d50c3

Please sign in to comment.