Skip to content

Commit

Permalink
Always evaluate preprocessing workflow Outcome
Browse files Browse the repository at this point in the history
  • Loading branch information
djjuhasz committed Jun 18, 2024
1 parent 9564b21 commit 786453a
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions internal/workflow/processing.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,18 +946,16 @@ func (w *ProcessingWorkflow) preprocessing(ctx temporalsdk_workflow.Context, tin
if err != nil {
return err
}

switch ppResult.Outcome {
case preprocessing.OutcomeSuccess:
return nil
case preprocessing.OutcomeSystemError:
return errors.New("preprocessing workflow: system error")
case preprocessing.OutcomeContentError:
return errors.New("preprocessing workflow: validation failed")
default:
return fmt.Errorf("preprocessing workflow: unknown outcome %d", ppResult.Outcome)
}
}

return nil
switch ppResult.Outcome {
case preprocessing.OutcomeSuccess:
return nil
case preprocessing.OutcomeSystemError:
return errors.New("preprocessing workflow: system error")
case preprocessing.OutcomeContentError:
return errors.New("preprocessing workflow: validation failed")
default:
return fmt.Errorf("preprocessing workflow: unknown outcome %d", ppResult.Outcome)

Check warning on line 959 in internal/workflow/processing.go

View check run for this annotation

Codecov / codecov/patch

internal/workflow/processing.go#L954-L959

Added lines #L954 - L959 were not covered by tests
}
}

0 comments on commit 786453a

Please sign in to comment.