Skip to content

Commit a888735

Browse files
committed
typedErasedWorkflow does not need to handle errors: it is always called within the goroutine started with ctx.RunWorkflow, and its error is always recorded
1 parent 066c137 commit a888735

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

dbos/workflow.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -449,21 +449,6 @@ func RegisterWorkflow[P any, R any](ctx DBOSContext, fn Workflow[P, R], opts ...
449449
typedErasedWorkflow := WorkflowFunc(func(ctx DBOSContext, input any) (any, error) {
450450
typedInput, ok := input.(P)
451451
if !ok {
452-
wfID, err := ctx.GetWorkflowID()
453-
if err != nil {
454-
return nil, fmt.Errorf("failed to get workflow ID: %w", err)
455-
}
456-
noCancelCtx := WithoutCancel(ctx)
457-
err = retry(noCancelCtx, func() error {
458-
return ctx.(*dbosContext).systemDB.updateWorkflowOutcome(noCancelCtx, updateWorkflowOutcomeDBInput{
459-
workflowID: wfID,
460-
status: WorkflowStatusError,
461-
err: newWorkflowUnexpectedInputType(fqn, fmt.Sprintf("%T", typedInput), fmt.Sprintf("%T", input)),
462-
})
463-
}, withRetrierLogger(ctx.(*dbosContext).logger))
464-
if err != nil {
465-
return nil, fmt.Errorf("failed to record unexpected input type error: %w", err)
466-
}
467452
return nil, newWorkflowUnexpectedInputType(fqn, fmt.Sprintf("%T", typedInput), fmt.Sprintf("%T", input))
468453
}
469454
return fn(ctx, typedInput)

0 commit comments

Comments
 (0)