Question: Using relayed calls, when an error happens in the contract, how do we(devs) know? Because i have a require condition in my GNS-aware smart contract, but i deliberately didn’t send what is required, but the error didn’t specifically tell me what went wrong even though i returned the possible cause from within my smart contract.
If you want to reject a request to relay a call, then your contract should return _rejectRelayedCall in approveRelayedCall.
The error number passed to _rejectRelayedCall will be available on the client.
For example, GSNReceipientERC20Fee.sol:
When a request to relay a call is rejected, then the recipient contract is not charged gas as the relayer will never send the transaction.
If the request to relay a call is approved by the logic in approveRelayedCall, and the call ends up reverting then the recipient contract will be charged and the revert information will not be available.
We want to write the approveRelayedCall in such a way that ensures that if approved, it won’t be reverted.