Skip to content

Commit

Permalink
Merge pull request kubernetes#94078 from DataDog/armclient-errors-han…
Browse files Browse the repository at this point in the history
…dling

ARM client: survive empty response and error
  • Loading branch information
k8s-ci-robot authored Sep 7, 2020
2 parents 164e9fe + d16eee0 commit e7420a4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ func (c *Client) sendRequest(ctx context.Context, request *http.Request) (*http.
request,
retry.DoExponentialBackoffRetry(&sendBackoff),
)

if response == nil && err == nil {
return response, retry.NewError(false, fmt.Errorf("Empty response and no HTTP code"))
}

return response, retry.GetError(response, err)
}

Expand Down

0 comments on commit e7420a4

Please sign in to comment.