MCPcopy Create free account
hub / github.com/cockroachdb/errors / TestBarrierMessage

Function TestBarrierMessage

barriers/barriers_test.go:48–58  ·  view source on GitHub ↗

This test demonstrates how the message is preserved (or not) depending on how the barrier is constructed.

(t *testing.T)

Source from the content-addressed store, hash-verified

46// This test demonstrates how the message is preserved (or not) depending
47// on how the barrier is constructed.
48func TestBarrierMessage(t *testing.T) {
49 tt := testutils.T{T: t}
50
51 origErr := errors.New("hello")
52
53 b1 := barriers.Handled(origErr)
54 tt.CheckEqual(b1.Error(), origErr.Error())
55
56 b2 := barriers.HandledWithMessage(origErr, "woo")
57 tt.CheckEqual(b2.Error(), "woo")
58}
59
60// This test demonstrates that the original error details
61// are preserved through barriers, even when they go through the network.

Callers

nothing calls this directly

Calls 4

CheckEqualMethod · 0.95
HandledFunction · 0.92
HandledWithMessageFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…