Skip to content

Commit

Permalink
allow retrying of async query
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispatrick authored and Paul Norton committed Jan 8, 2024
1 parent 360870f commit 8244497
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions policy/policy_handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func (h EventHandler) handle(ctx context.Context, req skill.RequestContext) skil
for _, provider := range h.dataSourceProviders {
ds, err := provider(ctx, req)
if err != nil {
if err.Error() == "An unexpected error has occurred" {
return skill.NewRetryableStatus(fmt.Sprintf("Failed to create data source [%s]", err.Error()))
}
return skill.NewFailedStatus(fmt.Sprintf("failed to create data source [%s]", err.Error()))
}
sources = append(sources, ds...)
Expand Down

0 comments on commit 8244497

Please sign in to comment.