chore: improve errors and tests

This commit is contained in:
2024-03-23 21:05:57 +00:00
parent 5247fbd90b
commit ccc3668fa2
7 changed files with 262 additions and 30 deletions

View File

@@ -17,7 +17,7 @@ var _ FormatRenderer = (*Binary)(nil)
func (bm *Binary) Render(w io.Writer, v any) error {
x, ok := v.(encoding.BinaryMarshaler)
if !ok {
return ErrCannotRender
return fmt.Errorf("%w: %T", ErrCannotRender, v)
}
b, err := x.MarshalBinary()