|
@@ -403,8 +403,7 @@ func fetchURL(source string, timeout time.Duration) (io.ReadCloser, error) {
|
403
|
403
|
func statusCodeError(resp *http.Response) error {
|
404
|
404
|
if resp.Header.Get("X-Go-Pprof") != "" && strings.Contains(resp.Header.Get("Content-Type"), "text/plain") {
|
405
|
405
|
// error is from pprof endpoint
|
406
|
|
- body, err := ioutil.ReadAll(resp.Body)
|
407
|
|
- if err == nil {
|
|
406
|
+ if body, err := ioutil.ReadAll(resp.Body); err == nil {
|
408
|
407
|
return fmt.Errorf("server response: %s - %s", resp.Status, body)
|
409
|
408
|
}
|
410
|
409
|
}
|