MCPcopy Index your code
hub / github.com/cockroachdb/errors / TestMixedErrorWrapping

Function TestMixedErrorWrapping

errbase/unwrap_test.go:51–60  ·  view source on GitHub ↗

This test demonstrates how errbase.UnwrapOnce/errbase.UnwrapAll are able to use either Cause() or errbase.Unwrap().

(t *testing.T)

Source from the content-addressed store, hash-verified

49// This test demonstrates how errbase.UnwrapOnce/errbase.UnwrapAll are able to use
50// either Cause() or errbase.Unwrap().
51func TestMixedErrorWrapping(t *testing.T) {
52 tt := testutils.T{T: t}
53
54 err := errors.New("hello")
55 err2 := pkgErr.WithMessage(err, "woo")
56 err3 := &myWrapper{cause: err2}
57
58 tt.CheckEqual(errbase.UnwrapOnce(err3), err2)
59 tt.CheckEqual(errbase.UnwrapAll(err3), err)
60}
61
62func TestMultiErrorUnwrap(t *testing.T) {
63 tt := testutils.T{T: t}

Callers

nothing calls this directly

Calls 3

CheckEqualMethod · 0.95
UnwrapOnceFunction · 0.92
UnwrapAllFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…