origin-js icon indicating copy to clipboard operation
origin-js copied to clipboard

Propagate require() reasons to the DApp

Open cuongdo opened this issue 5 years ago • 1 comments

When a require() in our contracts fails, they usually have a reason string that propagates to web3. This reason string is visible in our tests. For some reason, the require() is not propagating to to the DApp. Instead, we get a generic and unhelpful JSON-RPC error. This should be fixed to avoid wasting time investigating what should be simple issues.

cuongdo avatar Sep 27 '18 21:09 cuongdo

It doesn't look like this is possible (yet), because MetaMask isn't propagating the reason string:

https://github.com/MetaMask/metamask-extension/issues/4559

I'll see if there's another way, but I'm not too optimistic, because the error object thrown by MetaMask doesn't contain any info except the error code and the generic error message.

cuongdo avatar Sep 28 '18 01:09 cuongdo