Solidity: Custom Error Message in require() Not Showing

requiresolidity

I've got Solidity v0.4.24

And I'm doing this:

require(false,"this is a test");

When I run truffle test I get the revert, but I cant see the error message.

Any ideas what could be wrong?

Best Answer

You can't currently use web3 to inspect error messages thrown from revert. In the future it may be possible though, so adding these to your smart contract helps to future proof against this development.

You can follow the discussion at:
https://github.com/ethereum/EIPs/pull/658

Related Topic