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 context to contract exceptions #1743

Closed
YaroShkvorets opened this issue Oct 10, 2023 · 0 comments · Fixed by #1744
Closed

Add context to contract exceptions #1743

YaroShkvorets opened this issue Oct 10, 2023 · 0 comments · Fixed by #1744

Comments

@YaroShkvorets
Copy link
Contributor

Problem

There is that annoying problem with errors coming from smart contracts.
When your smart contract makes inline action calls to external contracts and one of these actions fails, you just get an error with zero context, so you can’t tell which smart contract and action that error came from. You can probably recognize your own errors but not some random errors coming from other contracts.

I.e. you only get this:

Error 3070002: Runtime Error Processing WASM
Error Details:
access violation
pending console output:
Stack Trace:
executor.cpp:257 execute
apply_context.cpp:124 exec_one

Assertion "check" failures also have this problem:

Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: read
pending console output:
Stack Trace:
cf_system.cpp:22 eosio_assert_message
apply_context.cpp:124 exec_one

This makes debugging quite painful.

Proposal

Add additional context to the error message:

  • smart contract account
  • action name
  • receiver (to distinguish action calls from notification handlers)
@enf-ci-bot enf-ci-bot moved this to Todo in Team Backlog Oct 10, 2023
YaroShkvorets added a commit to YaroShkvorets/leap that referenced this issue Oct 10, 2023
@heifner heifner linked a pull request Oct 11, 2023 that will close this issue
heifner added a commit that referenced this issue Oct 11, 2023
…ceptions

Add action context to contract error message
@github-project-automation github-project-automation bot moved this from Todo to Done in Team Backlog Oct 11, 2023
@heifner heifner removed the triage label Oct 11, 2023
YaroShkvorets added a commit to YaroShkvorets/leap that referenced this issue Nov 14, 2023
heifner added a commit that referenced this issue Nov 15, 2023
…ntract-exceptions

[5.0] Add context to contract exceptions
heifner added a commit that referenced this issue Nov 15, 2023
heifner added a commit that referenced this issue Nov 15, 2023
…act-exceptions-main

[5.0 -> main] Add context to contract exceptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants