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)
| 145 | // or a different type, ensure that RegisterTypeMigration() was called |
| 146 | // prior to RegisterLeafDecoder(). |
| 147 | func 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. |
no outgoing calls
searching dependent graphs…