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

Function RegisterWrapperEncoderWithMessageType

errbase/encode.go:412–418  ·  view source on GitHub ↗

RegisterWrapperEncoderWithMessageType can be used to register new wrapper types to the library. Registered wrappers will be encoded using their own Go type when an error is encoded. Wrappers that have not been registered will be encoded using the opaqueWrapper type. This function differs from Regis

(theType TypeKey, encoder WrapperEncoderWithMessageType)

Source from the content-addressed store, hash-verified

410// or a different type, ensure that RegisterTypeMigration() was called
411// prior to RegisterWrapperEncoder().
412func RegisterWrapperEncoderWithMessageType(theType TypeKey, encoder WrapperEncoderWithMessageType) {
413 if encoder == nil {
414 delete(encoders, theType)
415 } else {
416 encoders[theType] = encoder
417 }
418}
419
420// WrapperEncoder is to be provided (via RegisterWrapperEncoder above)
421// by additional wrapper types not yet known to this library.

Callers 3

initFunction · 0.92
RegisterWrapperEncoderFunction · 0.70

Calls

no outgoing calls

Tested by 1

initFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…