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

proposal: push error map onchain and show abort reason when txn failed. #2675

Open
pause125 opened this issue Sep 23, 2024 · 1 comment
Open
Labels
proposal New external API or other notable changes

Comments

@pause125
Copy link
Collaborator

Proposal Details

Fow now, if a txn fails, the output message is like:

    "status": {
      "type": "moveabort",
      "location": "0x2::module_store",
      "abort_code": "2"
    }

or

    "vm_error_info": {
      "error_message": "VMError with status ABORTED with sub status 2 at location Module ModuleId { address: 0000000000000000000000000000000000000000000000000000000000000002, name: Identifier(\"module_store\") } and message 0x0000000000000000000000000000000000000000000000000000000000000002::module_store::publish_package_entry at offset 62 at code offset 62 in function definition 25",
      "execution_state": []
    }

The developer need to check the source file for the reason or use rooch move explain to expain framework's abort reason. And what's more to auto explain the reason to end user.

Proposal
Can we store error map onchain when publishing modules, and then add an abort reason field in the transation output?

@pause125 pause125 added the proposal New external API or other notable changes label Sep 23, 2024
@jolestar
Copy link
Contributor

We can explain the error code in the vm_error_info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal New external API or other notable changes
Projects
Status: No status
Development

No branches or pull requests

2 participants