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

Function RegisterLeafDecoder

errbase/decode.go:147–153  ·  view source on GitHub ↗

RegisterLeafDecoder can be used to register new leaf error types to the library. Registered types will be decoded using their own Go type when an error is decoded. Wrappers that have not been registered will be decoded using the opaqueLeaf type. Note: if the error type has been migrated from a prev

(theType TypeKey, decoder LeafDecoder)

Source from the content-addressed store, hash-verified

145// or a different type, ensure that RegisterTypeMigration() was called
146// prior to RegisterLeafDecoder().
147func RegisterLeafDecoder(theType TypeKey, decoder LeafDecoder) {
148 if decoder == nil {
149 delete(leafDecoders, theType)
150 } else {
151 leafDecoders[theType] = decoder
152 }
153}
154
155// LeafDecoder is to be provided (via RegisterLeafDecoder above)
156// by additional wrapper types not yet known to this library.

Callers 14

RegisterLeafDecoderFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…