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
Use in-house Web3 exceptions for all of the codebase #3300
Use in-house Web3 exceptions for all of the codebase #3300
Conversation
2a20a19
to
d3e45ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No major concerns, lgtm!
Noticed two empty files, tests/core/pm-module/test_ens_integration.py and web3/tools/pytest_ethereum/deployer.py
d3e45ea
to
5011b41
Compare
5011b41
to
6200970
Compare
My ultimate question here is whether or not it answers the call to have a more specific error thrown? I suppose we can take care of that part after as well. This helps with user exception handling, ideally catching all (or close to all) @kclowes I'll wait for your review / input on this since you seem to be in this conversation quite a while longer than I. cc: @LefterisJP for input via this comment. |
6200970
to
686d430
Compare
Exactly this is what prompted my original comment. To be able to catch all the library errors easily and not have to add extra
I am not sure I understand what you mean here. What kind of error would not be generic? Can you maybe give an example? cc @yabirgb from the rotki team here just an fyi for the upcoming changes and for potential input. |
I think your answer covered it. I just mean that in some cases a more specific class name may make more sense. Something like |
- `ValueError` -> `Web3ValueError(ValueError)` - `TypeError` -> `Web3TypeError(TypeError)` - `AssertionError` -> `Web3AssertionError(AssertionError)` - `AttributeError` -> `Web3AttributeError(AttributeError)`
686d430
to
a81227a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I left one nit on a file name, but that was all I saw. It'll be great to get this in!
What was wrong?
Web3Exception
for all exceptions within the library #3241How was it fixed?
ValueError
, raiseWeb3ValueError
and extend fromValueError
andWeb3Exception
TypeError
, raiseWeb3TypeError
and extend fromTypeError
andWeb3Exception
AssertionError
, raiseWeb3AssertionError
and extend fromAssertionError
andWeb3Exception
AttributeError
, raiseWeb3AttributeError
and extend fromAttributeError
andWeb3Exception
ENSValueError
andENSTypeError
as well. Seems like that could only help with better control over exception handling.Todo:
Cute Animal Picture