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

Add error handling to call and transact. #137

Merged
merged 19 commits into from
Oct 10, 2024
Merged

Conversation

slundqui
Copy link
Contributor

This PR wraps web3py exceptions with another exception that adds contract call information. This information can then be used to e.g., create a crash report. Note the thrown wrapped exceptions can be caught with both the original web3 exception and the new PypechainCallException.

@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 54.04313% with 341 lines in your changes missing coverage. Please review.

Project coverage is 70.06%. Comparing base (f9d292c) to head (01a33ff).

Files with missing lines Patch % Lines
...ain/test/return_types/types/ReturnTypesContract.py 54.08% 73 Missing ⚠️
...est/overloading/types/OverloadedMethodsContract.py 51.00% 49 Missing ⚠️
pypechain/test/structs/types/StructsAContract.py 26.19% 31 Missing ⚠️
...loyment/types/ConstructorWithStructArgsContract.py 35.71% 27 Missing ⚠️
pypechain/test/events/types/EventsContract.py 35.71% 27 Missing ⚠️
pypechain/test/structs/types/StructsBContract.py 27.58% 21 Missing ⚠️
pypechain/test/structs/types/StructsCContract.py 27.58% 21 Missing ⚠️
...test/deployment/types/ConstructorNoArgsContract.py 41.37% 17 Missing ⚠️
...st/deployment/types/ConstructorWithArgsContract.py 41.37% 17 Missing ⚠️
...ain/test/deployment/types/NoConstructorContract.py 41.37% 17 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
- Coverage   74.35%   70.06%   -4.30%     
==========================================
  Files          57       59       +2     
  Lines        2995     3638     +643     
==========================================
+ Hits         2227     2549     +322     
- Misses        768     1089     +321     
Flag Coverage Δ
unittests 70.06% <54.04%> (-4.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@slundqui slundqui merged commit 2eb3bb7 into main Oct 10, 2024
6 checks passed
@slundqui slundqui deleted the slundquist-error-handling branch October 10, 2024 21:24
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.

3 participants