channeldb/codec: add NewUnknownElementType constructor

This commit is contained in:
Conner Fromknecht 2019-04-26 17:20:23 -07:00
parent 2ce6228021
commit 678ca9feff
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

@ -51,6 +51,12 @@ type UnknownElementType struct {
element interface{}
}
// NewUnknownElementType creates a new UnknownElementType error from the passed
// method name and element.
func NewUnknownElementType(method string, el interface{}) UnknownElementType {
return UnknownElementType{method: method, element: el}
}
// Error returns the name of the method that encountered the error, as well as
// the type that was unsupported.
func (e UnknownElementType) Error() string {