Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Passing error messages from require down to the client in truffle-contract #1153

Closed
aleybovich opened this issue Jul 26, 2018 · 3 comments
Closed

Comments

@aleybovich
Copy link

aleybovich commented Jul 26, 2018

  • [ x] I've asked for help in the Truffle Gitter before filing this issue.

Issue

There is no way of getting the actual error message when a require statements throws.

Steps to Reproduce

Have a contract that throws in require with an error message, like

require(1 == 2, "1 is not equal 2, dummy!")

Expected Behavior

The error message that the client receives includes the above error message

Actual Results

The client gets a generic VM Exception while processing transaction: revert message

Environment

Truffle v4.1.11 (core: 4.1.11)
Solidity v0.4.24 (solc-js)

Solidty docs talk about the error messages and how they are returned (at the bottom of the page): http://solidity.readthedocs.io/en/v0.4.24/control-structures.html

@cgewecke
Copy link
Contributor

@aleybovich This has been implemented in Truffle V5, which we're planning to release in beta shortly. You can preview it by installing truffle at the @next tag and there is a draft release notes with detailed instructions open as a PR here. Checkout the web3 1.0 section for more detail about reason strings.

$ npm install truffle@next

There's another issue about this - #976 - would it be ok if we track it there?

@aleybovich
Copy link
Author

@cgewecke - no problem, I'll close this one. Is V5 stable enough/feature complete to start using it?

@cgewecke
Copy link
Contributor

cgewecke commented Jul 26, 2018

@aleybovich I'm using it right now to write the tests for a package registry at EthPM here. And Colony has a PR open upgrading to it. That said I wouldn't describe it as "stable" and there are various small bugs still to work out.

Also contains significant breaking changes in truffle-contract - returning BN instead of BigNumber is the main one.

Obviously you're welcome to try it out - would love feedback and bug reports.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants