add error handler to cannon build process and all exported artifacts #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have just pushed an advanced error handling/intercepting system in cannon. You can expect it to kick in when cannon is building (including during
run
steps), or when using the provider supplied by cannon after running the hardhat job (ex. when running integration tests!). In the future, this should also be usable in the frontend as well using the wrapper provider.here is an example of the output when I just added
revert("Its a failure")
to the sample greeter contract:notice how the error also includes the full calldata, any intermediate
contract calls (should be amazing for multi-contract projects!), and any
console.log
youmay have in your code, and any errors/revert reasons seen.
here is another example where, I add a line
uint testval = 1 / uint(0);
:custom solidity errors are also decoded:
if the error is not able to be decoded, the original error is returned
unmodified, so you don't need to worry about it making errors harder to
read than they already are.
Unfortunately anvil does not supply information regarding the contract
source code, which means you wont see any tracing for contract internal
calls.