Skip to content

#3241 Add web3 value error from Web3Exception for exceptions within the library #3299

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

Closed
wants to merge 3 commits into from

Conversation

MRLab12
Copy link

@MRLab12 MRLab12 commented Mar 25, 2024

What was wrong?

The issue was identified in the RequestManager class of the Web3.py library, where error responses were not being handled as expected, leading to ambiguity in error handling. The exception ValueError is making it difficult for developers to understand the context and use case of the error they are currently getting.

Related to Issue #3241

How was it fixed?

  • Added the Web3ValueError exception class to explicitly represent errors related to invalid values within the Web3.py context. This class enhances the granularity of error handling by distinctly addressing value-related issues.

  • Integrated the Web3ValueError within the formatted_response method of the RequestManager. Now, when formatted_response encounters an error condition indicative of a value issue, it raises Web3ValueError, thereby providing a more specific and meaningful error to the developer.

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@MRLab12 MRLab12 marked this pull request as draft March 25, 2024 19:23
@MRLab12 MRLab12 closed this Mar 25, 2024
@fselmo
Copy link
Collaborator

fselmo commented Mar 25, 2024

Hey @MRLab12 , I got your message over the weekend. I apologize that I wasn't quick enough to push my WIP branch and open a PR before I could answer you. Thankfully I don't think you did too much repetitive work there but if you'd like to contribute here I'm all for it. Otherwise I will try to hop in here and wrap it up this week. Thanks for the nudge and the contribution!

@fselmo
Copy link
Collaborator

fselmo commented Mar 25, 2024

Hey @MRLab12 , I got your message over the weekend. I apologize that I wasn't quick enough to push my WIP branch and open a PR before I could answer you. Thankfully I don't think you did too much repetitive work here but if you'd like to contribute there (#3300) I'm all for it. Otherwise I will try to wrap it up this week. Thanks for the nudge and the contribution!

@MRLab12
Copy link
Author

MRLab12 commented Mar 26, 2024

@fselmo Thank you for the reply! Yeah no worries, I intended for this PR to be an initial step to discuss potential changes that needed to happen. I can see from your branch that you are already further into the works that needs to be done. Looks like you got it handled, but I'm happy to help with anything if you need it. I want to contribute more to web3.py so looking for issues I can take on.

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 this pull request may close these issues.

2 participants