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

Function DecodeError

x/client/error.go:65–72  ·  view source on GitHub ↗

DecodeError binds a json error to the "destPtr".

(err error, destPtr interface{})

Source from the content-addressed store, hash-verified

63
64// DecodeError binds a json error to the "destPtr".
65func DecodeError(err error, destPtr interface{}) error {
66 apiErr, ok := GetError(err)
67 if !ok {
68 return err
69 }
70
71 return json.Unmarshal(apiErr.Body, destPtr)
72}
73
74// GetErrorCode reads an error, which should be a type of APIError,
75// and returns its status code.

Callers

nothing calls this directly

Calls 2

GetErrorFunction · 0.85
UnmarshalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…