Skip to content

Commit c5d50c3

Browse files
authored
Merge pull request #309 from cschleiden/remove-more-panics
Remove remaining panics
2 parents 9fbfb31 + e961fa1 commit c5d50c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/worker/workflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (wtw *WorkflowTaskWorker) Complete(ctx context.Context, result *workflow.Ex
7878
if err := wtw.backend.CompleteWorkflowTask(
7979
ctx, t, t.WorkflowInstance, state, result.Executed, result.ActivityEvents, result.TimerEvents, result.WorkflowEvents); err != nil {
8080
wtw.logger.ErrorContext(ctx, "could not complete workflow task", "error", err)
81-
panic("could not complete workflow task")
81+
return fmt.Errorf("completing workflow task: %w", err)
8282
}
8383

8484
return nil

internal/workflow/executor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func (e *executor) replayHistory(h []*history.Event) error {
245245
for _, event := range h {
246246
if event.SequenceID < e.lastSequenceID {
247247
e.logger.Error("history has older events than current state")
248-
panic("history has older events than current state")
248+
return errors.New("history has older events than current state")
249249
}
250250

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

0 commit comments

Comments
 (0)