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

Function RegisterLeafEncoder

errbase_api.go:128–130  ·  view source on GitHub ↗

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

(typeName TypeKey, encoder LeafEncoder)

Source from the content-addressed store, hash-verified

126// or a different type, ensure that RegisterTypeMigration() was called
127// prior to RegisterLeafEncoder().
128func RegisterLeafEncoder(typeName TypeKey, encoder LeafEncoder) {
129 errbase.RegisterLeafEncoder(typeName, encoder)
130}
131
132// LeafEncoder is to be provided (via RegisterLeafEncoder above)
133// by additional wrapper types not yet known to this library.

Callers

nothing calls this directly

Calls 1

RegisterLeafEncoderFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…