I was trying to validate a transaction with some conditions on contract level and was wondering if it was possible in any way to give user feedback in the frontend if a require() fails - aka if it returns false.


In contract:

function validate(x){
    require(x < y) --> outcome = false

In frontend: (fictional code)

catch RequireFailed
    //provide user feedback that the require failed.

So my question, is there any way to catch if a require fails, and if so.. How to catch it :)

Thanks in advance!

  • Please see here You can use then((result) { } )).catch(err) {} Feb 16, 2018 at 16:18


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.