Merge pull request #94078 from DataDog/armclient-errors-handling

ARM client: survive empty response and error
This commit is contained in:
Kubernetes Prow Robot 2020-09-06 20:55:42 -07:00 committed by GitHub
commit e7420a483f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}