UnwrapAll accesses the root cause object of the error. If the error has no cause (leaf error), it is returned directly. UnwrapAll treats multi-errors as leaf nodes.
(err error)
| 51 | // If the error has no cause (leaf error), it is returned directly. |
| 52 | // UnwrapAll treats multi-errors as leaf nodes. |
| 53 | func UnwrapAll(err error) error { |
| 54 | for { |
| 55 | if cause := UnwrapOnce(err); cause != nil { |
| 56 | err = cause |
| 57 | continue |
| 58 | } |
| 59 | break |
| 60 | } |
| 61 | return err |
| 62 | } |
| 63 | |
| 64 | // UnwrapMulti access the slice of causes that an error contains, if it is a |
| 65 | // multi-error. |
searching dependent graphs…