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

Function RootCause

pkg/errors/causes.go:80–89  ·  view source on GitHub ↗

RootCause walks up the "error chain" until it finds the root cause of an error.

(err error)

Source from the content-addressed store, hash-verified

78
79// RootCause walks up the "error chain" until it finds the root cause of an error.
80func RootCause(err error) error {
81 for err != nil {
82 cause := Cause(err)
83 if cause == nil {
84 return err
85 }
86 err = cause
87 }
88 return err
89}
90
91// Stack returns the entire error stack, including the given error.
92func Stack(err error) (stack []error) {

Callers 1

TestCauseFunction · 0.92

Calls 1

CauseFunction · 0.85

Tested by 1

TestCauseFunction · 0.74