MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / statusCodeError

Function statusCodeError

dgraph/cmd/debuginfo/debugging.go:103–111  ·  view source on GitHub ↗
(resp *http.Response)

Source from the content-addressed store, hash-verified

101}
102
103func statusCodeError(resp *http.Response) error {
104 if resp.Header.Get("X-Go-Pprof") != "" &&
105 strings.Contains(resp.Header.Get("Content-Type"), "text/plain") {
106 if body, err := io.ReadAll(resp.Body); err == nil {
107 return fmt.Errorf("server response: %s - %s", resp.Status, body)
108 }
109 }
110 return fmt.Errorf("server response: %s", resp.Status)
111}

Callers 1

fetchURLFunction · 0.85

Calls 2

GetMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected