MCPcopy
hub / github.com/benbjohnson/wtf / ErrorCode

Function ErrorCode

error.go:44–52  ·  view source on GitHub ↗

ErrorCode unwraps an application error and returns its code. Non-application errors always return EINTERNAL.

(err error)

Source from the content-addressed store, hash-verified

42// ErrorCode unwraps an application error and returns its code.
43// Non-application errors always return EINTERNAL.
44func ErrorCode(err error) string {
45 var e *Error
46 if err == nil {
47 return ""
48 } else if errors.As(err, &e) {
49 return e.Code
50 }
51 return EINTERNAL
52}
53
54// ErrorMessage unwraps an application error and returns its message.
55// Non-application errors always return "Internal error".

Callers 15

handleDialCreateMethod · 0.92
handleDialUpdateMethod · 0.92
ErrorFunction · 0.92
rollbarReportErrorFunction · 0.92
TestUserService_FindUserFunction · 0.92
CreateAuthMethod · 0.92
TestAuthService_FindAuthFunction · 0.92

Calls

no outgoing calls