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

Function GetErrorCode

x/client/error.go:78–85  ·  view source on GitHub ↗

GetErrorCode reads an error, which should be a type of APIError, and returns its status code. If the given "err" is nil or is not an APIError it returns 200, acting as we have no error.

(err error)

Source from the content-addressed store, hash-verified

76// If the given "err" is nil or is not an APIError it returns 200,
77// acting as we have no error.
78func GetErrorCode(err error) int {
79 apiErr, ok := GetError(err)
80 if !ok {
81 return http.StatusOK
82 }
83
84 return apiErr.Response.StatusCode
85}

Callers

nothing calls this directly

Calls 1

GetErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…