Fix panic when processing http response

pull/8/head
Pengfei Ni 2018-09-04 14:26:19 +08:00
parent f3b98a08b0
commit 071eb9f6bf
1 changed files with 6 additions and 1 deletions

View File

@ -361,7 +361,12 @@ func processHTTPRetryResponse(resp *http.Response, err error) (bool, error) {
}
if shouldRetryHTTPRequest(resp, err) {
glog.Errorf("processHTTPRetryResponse: backoff failure, will retry, HTTP response=%d, err=%v", resp.StatusCode, err)
if err != nil {
glog.Errorf("processHTTPRetryResponse: backoff failure, will retry, err=%v", err)
} else {
glog.Errorf("processHTTPRetryResponse: backoff failure, will retry, HTTP response=%d", resp.StatusCode)
}
// suppress the error object so that backoff process continues
return false, nil
}