Skip to content

Commit

Permalink
Fix NonRetryableErrors
Browse files Browse the repository at this point in the history
Wrapping an application error prevents preventing retries
  • Loading branch information
serprex committed Mar 13, 2024
1 parent d9995a7 commit caab8a9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,11 @@ func (a *FlowableActivity) SyncFlow(
err = errGroup.Wait()
if err != nil {
a.Alerter.LogFlowError(ctx, flowName, err)
return nil, fmt.Errorf("failed in pull records when: %w", err)
if temporal.IsApplicationError(err) {
return nil, err
} else {
return nil, fmt.Errorf("failed in pull records when: %w", err)
}
}
logger.Info("no records to push")

Expand Down Expand Up @@ -401,7 +405,11 @@ func (a *FlowableActivity) SyncFlow(
err = errGroup.Wait()
if err != nil {
a.Alerter.LogFlowError(ctx, flowName, err)
return nil, fmt.Errorf("failed to pull records: %w", err)
if temporal.IsApplicationError(err) {
return nil, err
} else {
return nil, fmt.Errorf("failed to pull records: %w", err)
}
}

numRecords := res.NumRecordsSynced
Expand Down

0 comments on commit caab8a9

Please sign in to comment.