HasAssertionFailure returns true if the error or any of its causes is an assertion failure annotation.
(err error)
| 41 | // HasAssertionFailure returns true if the error or any of its causes |
| 42 | // is an assertion failure annotation. |
| 43 | func HasAssertionFailure(err error) bool { |
| 44 | _, ok := markers.If(err, func(err error) (v interface{}, ok bool) { |
| 45 | v, ok = err.(*withAssertionFailure) |
| 46 | return |
| 47 | }) |
| 48 | return ok |
| 49 | } |
| 50 | |
| 51 | // IsAssertionFailure returns true if the error (not its causes) is an |
| 52 | // assertion failure annotation. Consider using markers.If or |
searching dependent graphs…