MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / HasCode

Function HasCode

pkg/errors/codes.go:74–76  ·  view source on GitHub ↗

HasCode returns whether the given error has the given error code. If the error doesn't implement codes, it doesn't have any code.

(err error, c uint32)

Source from the content-addressed store, hash-verified

72// HasCode returns whether the given error has the given error code.
73// If the error doesn't implement codes, it doesn't have any code.
74func HasCode(err error, c uint32) bool {
75 return code(err) == c
76}
77
78// IsCanceled returns whether the givenerror is context.Canceled or of type Canceled.
79func IsCanceled(err error) bool {

Callers 15

IsCanceledFunction · 0.85
IsUnknownFunction · 0.85
IsInvalidArgumentFunction · 0.85
IsDeadlineExceededFunction · 0.85
IsNotFoundFunction · 0.85
IsAlreadyExistsFunction · 0.85
IsPermissionDeniedFunction · 0.85
IsResourceExhaustedFunction · 0.85
IsFailedPreconditionFunction · 0.85
IsAbortedFunction · 0.85
IsUnimplementedFunction · 0.85
IsInternalFunction · 0.85

Calls 1

codeFunction · 0.85

Tested by

no test coverage detected