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

Function RegisterWrapperDecoder

errbase/decode.go:171–177  ·  view source on GitHub ↗

RegisterWrapperDecoder can be used to register new wrapper types to the library. Registered wrappers will be decoded using their own Go type when an error is decoded. Wrappers that have not been registered will be decoded using the opaqueWrapper type. Note: if the error type has been migrated from

(theType TypeKey, decoder WrapperDecoder)

Source from the content-addressed store, hash-verified

169// or a different type, ensure that RegisterTypeMigration() was called
170// prior to RegisterWrapperDecoder().
171func RegisterWrapperDecoder(theType TypeKey, decoder WrapperDecoder) {
172 if decoder == nil {
173 delete(decoders, theType)
174 } else {
175 decoders[theType] = decoder
176 }
177}
178
179// WrapperDecoder is to be provided (via RegisterWrapperDecoder above)
180// by additional wrapper types not yet known to this library.

Callers 15

RegisterWrapperDecoderFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92
initFunction · 0.92

Calls

no outgoing calls

Tested by 2

initFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…