Skip to content

Commit

Permalink
Handle proxy errors with non-json response.
Browse files Browse the repository at this point in the history
  • Loading branch information
hchienjo committed Mar 5, 2024
1 parent a911253 commit 2a3c667
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions avroregistry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ func (r *Registry) doRequest(req *http.Request, result interface{}) error {
} else {
return apiErr
}
} else {
// some 5XX response body cannot be decoded
// hence an *apiError is not returned
if resp.StatusCode/100 == 5 {
err = &UnavailableError{apiErr}
}
}

if !attempt.More() {
Expand Down

0 comments on commit 2a3c667

Please sign in to comment.