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

Function FormatError

pkg/util/test/util.go:29–41  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

27)
28
29func FormatError(err error) string {
30 if err == nil {
31 return "nil"
32 }
33 var s strings.Builder
34 for i, err := range errors.Stack(err) {
35 s.WriteString(fmt.Sprintf(`
36%s-> %s (attributes: %v)`,
37 strings.Repeat("-", i), err, errors.Attributes(err),
38 ))
39 }
40 return s.String()
41}
42
43// Delay is the value, which can be used to slowdown the execution of time-dependent tests.
44// You can assume, that most function calls will return in at most Delay time.

Callers 12

TestDeviceRegistrySetFunction · 0.92
NewRedisDeviceRegistryFunction · 0.92
TestPopTaskFunction · 0.92
TestTaskQueueFunction · 0.92
TestMarshalersFunction · 0.92
MustFunction · 0.85

Calls 3

StackFunction · 0.92
AttributesFunction · 0.92
StringMethod · 0.65

Tested by 6

TestDeviceRegistrySetFunction · 0.74
TestPopTaskFunction · 0.74
TestTaskQueueFunction · 0.74
TestMarshalersFunction · 0.74