You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike other queries ContractCallQuery can execute contract transaction logic even though it doesn't change state or get gossiped out.
As a result it's important to have more details regarding why a contract execution failed.
Currently the error details are limited to {"name":"StatusError","status":"CONTRACT_REVERT_EXECUTED","transactionId":"[email protected]","message":"transaction [email protected] failed precheck with status CONTRACT_REVERT_EXECUTED"}
The network exposes this in the ContractFunctionResult which should be returned on all calls including failure as it includes the reason/error message.
It seems the java SDK exposes this but the logic is missing on the js version.
This results in eth devs who will predominately use the relay missing on the details they need to debug
Solution
Expose the ContractFunctionResult details on error.
Especially ContractFunctionResult.errorMessage
This will allow the relay to retrieve the information and pass it on to clients that submit contract call queries.
Alternatives
No response
The text was updated successfully, but these errors were encountered:
letresult;try{result=awaitnewContractCallQuery().setContractId(contract).setQueryPayment(newHbar(5)).setGas(75000).setFunction("getMessage").execute(env.client);}catch(error){if(errorinstanceofPrecheckStatusError){if(error.status===Status.ContractRevertExecuted){// do something with: error.contractFunctionResult}}throwerror;}
Problem
Unlike other queries
ContractCallQuery
can execute contract transaction logic even though it doesn't change state or get gossiped out.As a result it's important to have more details regarding why a contract execution failed.
Currently the error details are limited to
{"name":"StatusError","status":"CONTRACT_REVERT_EXECUTED","transactionId":"[email protected]","message":"transaction [email protected] failed precheck with status CONTRACT_REVERT_EXECUTED"}
The network exposes this in the
ContractFunctionResult
which should be returned on all calls including failure as it includes the reason/error message.It seems the java SDK exposes this but the logic is missing on the js version.
This results in eth devs who will predominately use the relay missing on the details they need to debug
Solution
Expose the ContractFunctionResult details on error.
Especially ContractFunctionResult.errorMessage
This will allow the relay to retrieve the information and pass it on to clients that submit contract call queries.
Alternatives
No response
The text was updated successfully, but these errors were encountered: