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

Function ConvertError

pkg/redis/errors.go:33–47  ·  view source on GitHub ↗

ConvertError converts Redis error into errors.Error.

(err error)

Source from the content-addressed store, hash-verified

31
32// ConvertError converts Redis error into errors.Error.
33func ConvertError(err error) error {
34 ttnErr, ok := errors.From(err)
35 if ok {
36 return ttnErr
37 }
38 switch err {
39 case nil:
40 return nil
41 case redis.Nil:
42 return errNotFound.New()
43 case redis.TxFailedErr:
44 return errTransactionFailed.New()
45 }
46 return errStore.WithCause(err)
47}

Callers 12

ScanProtoMethod · 0.85
initTaskGroupFunction · 0.85
addTaskFunction · 0.85
dispatchTaskFunction · 0.85
popTaskFunction · 0.85
CloseMethod · 0.85
DeduplicateProtosFunction · 0.85
LockMutexFunction · 0.85
UnlockMutexFunction · 0.85
InitMutexFunction · 0.85
LockedWatchFunction · 0.85
RangeStreamsFunction · 0.85

Calls 3

FromFunction · 0.92
NewMethod · 0.65
WithCauseMethod · 0.45

Tested by

no test coverage detected