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
I've been trying for the last while to get the fail result from the contract from ExecutionFailure. For ExecutionSuccess this is fine because I can return the json, borsh or raw_bytes quite easily. However, this isn't exceptionally straightforward on how to return the value field from ExecutionFailure! This would be an improvement if it is possible to return similar types as it is possible for successes.
The text was updated successfully, but these errors were encountered:
The value: TxExecutionError field for ExecutionFailure is meant to be hidden as we do not want to expose it as a transient dependency. There's no direct methods to usually interact with it unless you require something from it? It doesn't return bytes, so there's nothing to be operated on it like you'd do with json/borsh in the case of successful execution. It's moreso an opaque error type, and not meant to be directly handled besides just for debugging purposes; in which case you can format! it to get the error message.
Well, contracts should have a proper standard for error handling that is easy to react from the client side code: near/near-sdk-rs#936. I will keep this issue open and will try to push something from near-sdk-rs side first and then we can resolve this issue here as well. Meanwhile .to_string() is the only way to get the error.
I've been trying for the last while to get the fail result from the contract from
ExecutionFailure
. ForExecutionSuccess
this is fine because I can return thejson
,borsh
orraw_bytes
quite easily. However, this isn't exceptionally straightforward on how to return thevalue
field fromExecutionFailure
! This would be an improvement if it is possible to return similar types as it is possible for successes.The text was updated successfully, but these errors were encountered: