Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add optional error code to action trace #6898

Closed
arhag opened this issue Mar 8, 2019 · 1 comment
Closed

Add optional error code to action trace #6898

arhag opened this issue Mar 8, 2019 · 1 comment

Comments

@arhag
Copy link
Contributor

arhag commented Mar 8, 2019

Adding onto the major changes to transaction and action traces described in #6897, this will be a good opportunity (since transaction trace changes force replay for history_plugin users and may also have an impact on the definitions of the still alpha state history plugin) to add another value piece of information to the action trace: the error code.

The eosio_assert_code intrinsic allows contracts to signal the error with a simple uint64_t code rather than a full string. Error message maps in the ABI could be used to associate this code with a string to be included in the error message that is thrown (or included in action trace through maybe null except field). However, regardless of whether such a mapping exists, if an error code is thrown, the error code value should be included in the action trace.

So at a minimum a new field error_code of type optional<uint64_t> should be added to both base_action_trace and transaction_trace, and they should be set to the appropriate value if an action fails due to a call to eosio_assert_code. It would be good to also make the modifications to nodeos so that the exception thrown (and stored in the except field) includes the string associated with the error code in the contract's ABI (if present).

@arhag
Copy link
Contributor Author

arhag commented Apr 11, 2019

Resolved by #7108.

@arhag arhag closed this as completed Apr 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants