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

Function TestAdaptBaseGoErr

errbase/adapters_test.go:42–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestAdaptBaseGoErr(t *testing.T) {
43 // Base Go errors are preserved completely.
44 origErr := goErr.New("world")
45 t.Logf("start err: %# v", pretty.Formatter(origErr))
46
47 newErr := network(t, origErr)
48
49 tt := testutils.T{T: t}
50 // The library preserves the error message.
51 tt.CheckEqual(newErr.Error(), origErr.Error())
52
53 // It actually preserves the full structure of the message,
54 // including its Go type.
55 tt.CheckDeepEqual(newErr, origErr)
56}
57
58func TestAdaptGoSingleWrapErr(t *testing.T) {
59 origErr := fmt.Errorf("an error %w", goErr.New("hello"))

Callers

nothing calls this directly

Calls 4

CheckEqualMethod · 0.95
CheckDeepEqualMethod · 0.95
networkFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…