-
Notifications
You must be signed in to change notification settings - Fork 59
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap error returned from MarshalCBOR in MarshalerError #486
Comments
I agree with the desired behavior but wouldn't make the breaking change. Users who differentiate error handling behaviors based on specific errors from a cbor.Marshaler are exactly the same users that would potentially be broken by wrapping the error, and other users would only see marginal benefit. Instead of making this change and trying to communicate it loudly to users, WDYT about addressing this as part of a new marshaler interface (#485 (review))? |
@benluddy Thanks, I opened issue to add new interface as alternative to The new interface can address limitations of |
Currently, error returned from
MarshalCBOR()
are returned from codec as is, without being wrapped.PR #485 adds
MarshalerError
, which wraps error from well-formedness check for CBOR data item returned fromMarshalCBOR()
.However, error returned directly from
MarshalCBOR()
should also be wrapped inMarshalerError
to be consistent with Go'sencoding/json
package.Resolving this would be a breaking change due to different type of error being returned which only affects error handling of
Marshaler
.The text was updated successfully, but these errors were encountered: