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

Document web3.py exceptions and hierarchy at a high level #3442

Open
fselmo opened this issue Jul 25, 2024 · 0 comments
Open

Document web3.py exceptions and hierarchy at a high level #3442

fselmo opened this issue Jul 25, 2024 · 0 comments

Comments

@fselmo
Copy link
Collaborator

fselmo commented Jul 25, 2024

Document that all exceptions internal to web3.py inherit from a base Web3Exception class. RPC errors raise Web3RPCError and sometimes are fine-tuned to raise TransactionNotFound, BlockNotFound, TransactionIndexingInProgress, RequestTimedOut, etc...

It may be important to note that due to the nature of JSON-RPC, specifically error codes not being standardized and inconsistency in client error code implementations, it is sometimes necessary to parse error messages to raise a more fine-tuned exception - such as in the cases of TransactionIndexingInProgress and RequestTimedOut. We should document that if client teams decide to change their messaging, these exceptions may slip back to the more general Web3RPCError so that users are aware of this.

@fselmo fselmo self-assigned this Sep 17, 2024
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

No branches or pull requests

1 participant