Skip to content

Commit

Permalink
return unavailable errors for proxy errors too.
Browse files Browse the repository at this point in the history
  • Loading branch information
hchienjo committed Mar 4, 2024
1 parent ce50231 commit 5753d28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion avroregistry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (r *Registry) doRequest(req *http.Request, result interface{}) error {
return nil
}
if !attempt.More() {
return err
return &UnavailableError{err}
}
if err, ok := err.(*apiError); ok && err.StatusCode != http.StatusInternalServerError {
// It's not a 5xx error. We want to retry on 5xx
Expand All @@ -208,6 +208,9 @@ func (r *Registry) doRequest(req *http.Request, result interface{}) error {
// course (and there could also be an
// unavailable service that we're reaching
// through a proxy).
if !attempt.More() {
return &UnavailableError{err}
}
return err
}
}
Expand Down

0 comments on commit 5753d28

Please sign in to comment.