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

Catch the contract execution errors, and return an error msg to the user #963

Conversation

bchamagne
Copy link
Member

@bchamagne bchamagne commented Mar 29, 2023

Description

Catch contract execution error, so the worker does not crash.
We can't provide a detailed error message to the user because it is an erlang error message based on the code we generated after AST manipulation. We might be able to get the line number, I'll create an issue (#964) about it.

This PR is based on branch pr/netbox/802 which is the following PR: #802. Once it is merged, we will need to change the base branch.

Fixes #919

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

tested with manual contract execution & added unit tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Neylix Neylix changed the base branch from pr/netboz/802 to develop April 3, 2023 16:28
@bchamagne bchamagne force-pushed the 919-worker-handle-contract-crash branch from 65e496a to c9e7dce Compare April 3, 2023 17:17
@Neylix Neylix merged commit 3d06bb0 into archethic-foundation:develop Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements smart contracts Involve smart contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Smart Contracts: when the contract crash, we should not crash the worker
3 participants