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

What's the recommended way to get web3::Error descriptions? #216

Closed
0x-r4bbit opened this issue May 29, 2019 · 2 comments · Fixed by #217
Closed

What's the recommended way to get web3::Error descriptions? #216

0x-r4bbit opened this issue May 29, 2019 · 2 comments · Fixed by #217

Comments

@0x-r4bbit
Copy link

Between web3 0.6.0 and latest master there seems to be a breaking change in how web3::Error is implemented. In 0.6.0 I was able to rely on web3::Error to implement Error and therefore had a description() API.

This is no longer the case, so i was wondering how I can access a web3::Error's message when wrapping them in my own errors.

@tomusdrw
Copy link
Owner

@PascalPrecht std::error::Error::description is soft-deprecated, you should use Display instead. That said the fact that our types don't implement this trait is a bug, it got lost during the refactoring.

See #217

@0x-r4bbit
Copy link
Author

@tomusdrw thanks for the very quick update! Looks like I'll have to refactor my codebase to prefer Display over Error::description then first! :)

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