Recommended error handling pattern for secret contracts?

Hi. I am writing some smart contract code in Rust, but I have a question about error handling. The usual pattern for error handling in Rust uses Result and Error. But I see in secret contract code their use produces the error

the trait `eng_wasm::eng_pwasm_abi::eth::AbiType` is not implemented for `core::result::Result<(), Error>`

So how should potential errors and known failure conditions be handled in Enigma secret contracts?


1 Like

You can panic, as per the Calculator example

This is also how Salad does it.

Or do you have any other sorts of conditions in mind?


Ok, I will use that pattern for now. It feels a little dramatic for expected errors, but if that is the recommendation I can go with it.