We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WalkDeep
Give an tree of errors:
A + B - C | + D - E
For now WalkDeep walks A and multierr(B-C, D-E) and then returns. It isn't deep enough.
A
multierr(B-C, D-E)
An example of this:
func TestErr(t *testing.T) { serr := backup.MakeStoreBasedErr(42, multierr.Combine( errors.Annotate(berrors.ErrFailedToConnect, "oops"), berrors.ErrFailedToConnect.GenWithStack("whoa"))) require.True(t, berrors.Is(serr, berrors.ErrFailedToConnect)) }
Where StoreBasedErr is a wrapper of an err and implements Unwrap to its inner error, berrors.Is is simply:
StoreBasedErr
Unwrap
berrors.Is
func Is(err error, is *errors.Error) bool { errorFound := errors.Find(err, func(e error) bool { normalizedErr, ok := e.(*errors.Error) return ok && normalizedErr.ID() == is.ID() }) return errorFound != nil }
This testcase fails.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Give an tree of errors:
For now
WalkDeep
walksA
andmultierr(B-C, D-E)
and then returns. It isn't deep enough.An example of this:
Where
StoreBasedErr
is a wrapper of an err and implementsUnwrap
to its inner error,berrors.Is
is simply:This testcase fails.
The text was updated successfully, but these errors were encountered: