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

Unstructured errors returned from reverted transactions #2197

Closed
uluhonolulu opened this issue Jan 17, 2019 · 2 comments
Closed

Unstructured errors returned from reverted transactions #2197

uluhonolulu opened this issue Jan 17, 2019 · 2 comments
Labels
2.x 2.0 related issues Enhancement Includes improvements or optimizations

Comments

@uluhonolulu
Copy link

When we have a revert in a transaction, webę throws an error, and the error message contains the revert reason, which is great. However, the message looks like Returned error: VM Exception while processing transaction: revert Name of storage is required -- Reason given: Name of storage is required.. Which means that we have to parse the message in order to get the revert reason, and the parser code is going to break every time the message formatting is changed (e.g. "Reason given" is changed to "Reason provided").

Would be great to have it structured, e.g. have a separate field that contains the revert reason. Or even something like this:

{
  message: "Returned error: VM Exception while processing transaction: revert Name of storage
is required -- Reason given: Name of storage is required.",
  inner: {
    message: "VM Exception while processing transaction: revert",
    status: "REVERT",  //something that won't be changed or localized
    inner: {
      message: "Name of storage is required."
    }
  }
}

The reason (pun intended) is that we need to know 1) if the error was due to a revert and 2) if yes, what was the revert reason. This would be particularly helpful in automated tests, but also in UI.

@nivida nivida added the Enhancement Includes improvements or optimizations label Jan 18, 2019
@nivida
Copy link
Contributor

nivida commented Jan 18, 2019

Thanks for submitting this issue. The implementation of the solidity revert method is on our roadmap for the 1.0 stable release.

@nivida nivida added the 2.x 2.0 related issues label Jun 20, 2019
@nivida nivida mentioned this issue Nov 21, 2019
7 tasks
@nivida
Copy link
Contributor

nivida commented Dec 6, 2019

We have implemented this feature for 1.x and will release it on the next minor release. We will implement this feature also for 2.x and I'm closing this issue for now because we will anyways synchronize the existing features between 1.x and 2.x later.

@nivida nivida closed this as completed Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x 2.0 related issues Enhancement Includes improvements or optimizations
Projects
None yet
Development

No branches or pull requests

2 participants