MCPcopy Create free account
hub / github.com/DoNewsCode/core / err

Function err

unierr/error.go:359–367  ·  view source on GitHub ↗
(code codes.Code, e error, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

357}
358
359func err(code codes.Code, e error, msgAndArgs ...interface{}) *Error {
360 if len(msgAndArgs) == 0 {
361 return Wrap(e, code)
362 }
363 if s, ok := msgAndArgs[0].(string); ok {
364 return Wrapf(e, code, s, msgAndArgs[1:]...)
365 }
366 return Wrapf(e, code, e.Error(), msgAndArgs...)
367}
368
369func is(err error, code codes.Code) bool {
370 var serverError *Error

Callers 15

UnknownErrFunction · 0.85
CanceledErrFunction · 0.85
DeadlineExceededErrFunction · 0.85
AlreadyExistsErrFunction · 0.85
AbortedErrFunction · 0.85
OutOfRangeErrFunction · 0.85
UnimplementedErrFunction · 0.85
InternalErrFunction · 0.85
PermissionDeniedErrFunction · 0.85
InvalidArgumentErrFunction · 0.85
NotFoundErrFunction · 0.85
UnavailableErrFunction · 0.85

Calls 3

WrapFunction · 0.85
WrapfFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected