Skip to content
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

Error types do not implement Error::source #528

Closed
Aeledfyr opened this issue Mar 24, 2022 · 1 comment · Fixed by #530
Closed

Error types do not implement Error::source #528

Aeledfyr opened this issue Mar 24, 2022 · 1 comment · Fixed by #530
Milestone

Comments

@Aeledfyr
Copy link

Aeledfyr commented Mar 24, 2022

Both the ErrorKind type in bincode 1.3.3 and the EncodeError/DecodeError types in bincode 2.0.0-rc.1 do not implement the source method in std::error::Error, which allows for automatic introspection of error causes.

Implementing it in 1.3.3 should be trivial, as it should be possible to reusing the implementation of the deprecated cause method (which 1.3.3 implements).

I've noticed that bincode 1.0 appears to have a MSRV below the version in which source was added. Does this prevent the library from implementing it in any form, or can conditional compilation be used to implement it if the compiler version supports it?

@VictorKoenders
Copy link
Contributor

I agree this is a good idea. I've implemented this for bincode 2 in #530.

Bincode 1 is in maintenance mode, we don't plan to add new features in the foreseeable future.

@VictorKoenders VictorKoenders added this to the v2.0 milestone Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants