Trying to understand the idiomatic way we should set Errors
in Sui blockchain smart contracts.
From the provided examples it seems that we should define constants per different expected error i.e. in Marketplace smart contract two errors are defined:
// For when amount paid does not match the expected.
const EAmountIncorrect: u64 = 0;
// For when someone tries to delist without ownership.
const ENotOwner: u64 = 1;
Questions:
- what is the idiomatic Move-language way to name the error constants,
starting with the
E
character then camel case? - what if a dev assigns the same number to two or more errors?