MCPcopy Create free account
hub / github.com/google/pprof / statusCodeError

Function statusCodeError

internal/driver/fetch.go:542–550  ·  view source on GitHub ↗
(resp *http.Response)

Source from the content-addressed store, hash-verified

540}
541
542func statusCodeError(resp *http.Response) error {
543 if resp.Header.Get("X-Go-Pprof") != "" && strings.Contains(resp.Header.Get("Content-Type"), "text/plain") {
544 // error is from pprof endpoint
545 if body, err := io.ReadAll(resp.Body); err == nil {
546 return fmt.Errorf("server response: %s - %s", resp.Status, body)
547 }
548 }
549 return fmt.Errorf("server response: %s", resp.Status)
550}
551
552// isPerfFile checks if a file is in perf.data format. It also returns false
553// if it encounters an error during the check.

Callers 1

fetchURLFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…