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.
Example
In contract:
function validate(x){
require(x < y) --> outcome = false
}
In frontend: (fictional code)
try
contract.validate(1);
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!