MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / GetErrorCode

Function GetErrorCode

pkg/errcode/http_error.go:203–209  ·  view source on GitHub ↗

GetErrorCode get Error code from error returned by http invoke

(err error)

Source from the content-addressed store, hash-verified

201
202// GetErrorCode get Error code from error returned by http invoke
203func GetErrorCode(err error) int {
204 e := ParseError(err)
205 if e.needHTTPCode {
206 return e.ToHTTPCode()
207 }
208 return e.Code()
209}
210
211// Is check if error is equal to target error
212func Is(err error, e *Error) bool {

Callers 2

IsFunction · 0.85
TestGetErrorCodeFunction · 0.85

Calls 3

ParseErrorFunction · 0.85
ToHTTPCodeMethod · 0.80
CodeMethod · 0.45

Tested by 1

TestGetErrorCodeFunction · 0.68