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

Function EncodeError

errbase/encode.go:32–37  ·  view source on GitHub ↗

EncodeError encodes an error.

(ctx context.Context, err error)

Source from the content-addressed store, hash-verified

30
31// EncodeError encodes an error.
32func EncodeError(ctx context.Context, err error) EncodedError {
33 if cause := UnwrapOnce(err); cause != nil {
34 return encodeWrapper(ctx, err, cause)
35 }
36 return encodeLeaf(ctx, err, UnwrapMulti(err))
37}
38
39// encodeLeaf encodes a leaf error. This function accepts a `causes`
40// argument because we encode multi-cause errors using the Leaf

Callers 15

EncodeErrorFunction · 0.92
TestWithContextFunction · 0.92
TestBarrierMaskedDetailsFunction · 0.92
encodeBarrierFunction · 0.92
networkFunction · 0.92
TestDetailCaptureFunction · 0.92
TestIssueLinkFunction · 0.92
TestUnimplementedErrorFunction · 0.92
TestEncodeDecodeStatusFunction · 0.92
encodeWithSecondaryErrorFunction · 0.92

Calls 4

encodeWrapperFunction · 0.85
UnwrapMultiFunction · 0.85
UnwrapOnceFunction · 0.70
encodeLeafFunction · 0.70

Tested by 15

TestWithContextFunction · 0.74
TestBarrierMaskedDetailsFunction · 0.74
networkFunction · 0.74
TestDetailCaptureFunction · 0.74
TestIssueLinkFunction · 0.74
TestUnimplementedErrorFunction · 0.74
TestEncodeDecodeStatusFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…