MCPcopy
hub / github.com/dropbox/godropbox / RootError

Function RootError

errors/errors.go:222–232  ·  view source on GitHub ↗

Keep peeling away layers or context until a primitive error is revealed.

(ierr error)

Source from the content-addressed store, hash-verified

220
221// Keep peeling away layers or context until a primitive error is revealed.
222func RootError(ierr error) (nerr error) {
223 nerr = ierr
224 for i := 0; i < 20; i++ {
225 terr := unwrapError(nerr)
226 if terr == nil {
227 return nerr
228 }
229 nerr = terr
230 }
231 return fmt.Errorf("too many iterations: %T", nerr)
232}
233
234// Return the lowest-level DropboxError. This can be used when
235// reporting the stack of the original exception to try and get the most

Callers 3

TestRootErrorsFunction · 0.85
TestRootErrorFunction · 0.85
IsErrorFunction · 0.85

Calls 1

unwrapErrorFunction · 0.85

Tested by 2

TestRootErrorsFunction · 0.68
TestRootErrorFunction · 0.68