Open
Description
Right now it is unclear what kind of errors a contract (or even a function) can fail with. It would be nice to have a standardized way of declaring contract errors, something like this:
#[near_error]
pub enum MyError {
#[message("Caller is not the owner of this contract")]
NotTheOwner,
#[message("Caller is not allowed to call this function")]
NotAllowed,
}
We can then include all contract errors as a part of the ABI, this proposal also goes really well with the Result
-based error handling as we can statically infer what errors a function can fail with.
Metadata
Assignees
Labels
No labels
Type
Projects
Status
NEW❗