MCPcopy Index your code
hub / github.com/bytebase/bytebase / ErrorCode

Function ErrorCode

backend/common/error.go:85–93  ·  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

83// ErrorCode unwraps an application error and returns its code.
84// Non-application errors always return EINTERNAL.
85func ErrorCode(err error) Code {
86 var e *Error
87 if err == nil {
88 return Ok
89 } else if errors.As(err, &e) {
90 return e.Code
91 }
92 return Internal
93}
94
95// Wrapf is a helper function to wrap an Error with given code and formatted message.
96func Wrapf(err error, code Code, format string, args ...any) *Error {

Callers 7

failTaskRunsForHAMethod · 0.92
executeTaskRunMethod · 0.92
runTaskRunOnceMethod · 0.92
promoteTaskRunMethod · 0.92
UploadLicenseMethod · 0.92
UpdateIssueCommentMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected