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

Edit some ValueError() messages for more clarity #2146

Merged
merged 2 commits into from
Sep 13, 2021

Conversation

Snugface
Copy link
Contributor

@Snugface Snugface commented Sep 12, 2021

What was wrong?

A few of the error messages were confusing

How was it fixed?

With additional formatting and clarification

Todo:

Background

Errors such as "Cannot set data in estimateGas transaction" make me think that estimateGas() failed to set some data values in transaction provided to it. While instead what it means is that I myself, as an operator, am not supposed to set transaction['data'] field. And should leave it blank. This might be obvious to those experienced with web3.py, but it's extremely confusing to me.
Same with the generic ValueError at line 693. It took me an extra hour to understand what the error was actually saying, because of the format it was in: "cannot set to in estimateGas transaction", for example. Just how the hell is one supposed to understand that line? It is VERY confusing.

Cute Animal Picture

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

Summary: edited some ValueError() messages for more readability & clarity.

Background: Errors such as "Cannot set data in estimateGas transaction" make me think that estimateGas() failed to set some data values in transaction provided to it. While instead what it means is that I myself, as an operator, am not supposed to set transaction['data'] field. And should leave it blank. This might be obvious to those experienced with web3.py, but it's extremely confusing to me.
Same with the generic ValueError at line 693. It took me an extra hour to understand what the error was actually saying, because of the format it was in: "cannot set to in estimateGas transaction", for example. Just how the hell is one supposed to understand that line? It is VERY confusing.
@kclowes
Copy link
Collaborator

kclowes commented Sep 13, 2021

Thanks for the changes @Snugface! I'll add a newsfragment and merge!

@Snugface
Copy link
Contributor Author

Thanks for the changes @Snugface! I'll add a newsfragment and merge!

Well, it's a crude edit. I could have spent more time working on it, tbh
But I am glad to see that you are willing to merge it.
Thanks!

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