Struct odra_types::ExecutionError
source · pub struct ExecutionError(/* private fields */);Expand description
An error that can occur during smart contract execution
It is represented by an error code and a human-readable message.
Errors codes 0..32767 are available for the user to define custom error in smart contracts. 32768 code is a special code representing a violation of the custom error code space.
The rest of codes 32769..u16::MAX, are used internally by the framework.
Implementations§
source§impl ExecutionError
impl ExecutionError
sourcepub fn new(code: u16, msg: &str) -> Self
pub fn new(code: u16, msg: &str) -> Self
Creates an instance with specified code and message.
If the custom error code space is violated, an error with code 32768 is returned.
sourcepub fn unwrap_error() -> Self
pub fn unwrap_error() -> Self
Creates a specific type of error, meaning that value unwrapping failed.
pub fn non_payable() -> Self
pub fn can_not_transfer_to_contract() -> Self
pub fn reentrant_call() -> Self
pub fn contract_already_installed() -> Self
pub fn unknown_constructor() -> Self
pub fn native_token_transfer_error() -> Self
pub fn addition_overflow() -> Self
pub fn subtraction_overflow() -> Self
pub fn index_out_of_bounds() -> Self
pub fn zero_address() -> Self
pub fn address_creation_failed() -> Self
Trait Implementations§
source§impl Clone for ExecutionError
impl Clone for ExecutionError
source§fn clone(&self) -> ExecutionError
fn clone(&self) -> ExecutionError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ExecutionError
impl Debug for ExecutionError
source§impl From<AddressError> for ExecutionError
impl From<AddressError> for ExecutionError
source§fn from(error: AddressError) -> Self
fn from(error: AddressError) -> Self
Converts to this type from the input type.
source§impl From<ArithmeticsError> for ExecutionError
impl From<ArithmeticsError> for ExecutionError
source§fn from(error: ArithmeticsError) -> Self
fn from(error: ArithmeticsError) -> Self
Converts to this type from the input type.
source§impl From<CollectionError> for ExecutionError
impl From<CollectionError> for ExecutionError
source§fn from(error: CollectionError) -> Self
fn from(error: CollectionError) -> Self
Converts to this type from the input type.
source§impl From<ExecutionError> for OdraError
impl From<ExecutionError> for OdraError
source§fn from(error: ExecutionError) -> Self
fn from(error: ExecutionError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ExecutionError
impl RefUnwindSafe for ExecutionError
impl Send for ExecutionError
impl Sync for ExecutionError
impl Unpin for ExecutionError
impl UnwindSafe for ExecutionError
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more