MCPcopy Create free account
hub / github.com/kataras/iris / ExtractError

Function ExtractError

x/client/error.go:41–48  ·  view source on GitHub ↗

ExtractError returns the response wrapped inside an APIError.

(resp *http.Response)

Source from the content-addressed store, hash-verified

39
40// ExtractError returns the response wrapped inside an APIError.
41func ExtractError(resp *http.Response) APIError {
42 body, _ := io.ReadAll(resp.Body)
43
44 return APIError{
45 Response: resp,
46 Body: body,
47 }
48}
49
50// GetError reports whether the given "err" is an APIError.
51func GetError(err error) (APIError, bool) {

Callers 2

ReadJSONMethod · 0.85
ReadPlainMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…