HandleAsAssertionFailureDepth is like HandleAsAssertionFailure but the depth at which the call stack is captured can be specified.
(depth int, origErr error)
| 51 | // HandleAsAssertionFailureDepth is like HandleAsAssertionFailure but |
| 52 | // the depth at which the call stack is captured can be specified. |
| 53 | func HandleAsAssertionFailureDepth(depth int, origErr error) error { |
| 54 | err := barriers.Handled(origErr) |
| 55 | err = withstack.WithStackDepth(err, 1+depth) |
| 56 | err = assert.WithAssertionFailure(err) |
| 57 | return err |
| 58 | } |
| 59 | |
| 60 | // NewAssertionErrorWithWrappedErrf wraps an error and turns it into |
| 61 | // an assertion error. Both details from the original error and the |
no test coverage detected
searching dependent graphs…