Enum concordium_cis2::Cis2Error
source · [−]pub enum Cis2Error<R> {
InvalidTokenId,
InsufficientFunds,
Unauthorized,
Custom(R),
}
Expand description
The different errors the contract can produce.
Variants
InvalidTokenId
Invalid token id (Error code: -42000001).
InsufficientFunds
The balance of the token owner is insufficient for the transfer (Error code: -42000002).
Unauthorized
Sender is unauthorized to call this function (Error code: -42000003).
Custom(R)
Custom error
Trait Implementations
sourceimpl<T, X> From<CallContractError<T>> for Cis2Error<X> where
X: From<CallContractError<T>>,
impl<T, X> From<CallContractError<T>> for Cis2Error<X> where
X: From<CallContractError<T>>,
sourcefn from(err: CallContractError<T>) -> Self
fn from(err: CallContractError<T>) -> Self
Converts the error by wrapping it in Self::Custom.
sourceimpl<R: Into<Reject> + Serial> From<Cis2Error<R>> for Reject
impl<R: Into<Reject> + Serial> From<Cis2Error<R>> for Reject
Convert Cis2Error
into a reject with error code:
- InvalidTokenId: -42000001
- InsufficientFunds: -42000002
- Unauthorized: -42000003
- Custom: The error code of
R
.
Also serializes the Cis2Error
and adds it as the return value.
sourceimpl<X> From<LogError> for Cis2Error<X> where
X: From<LogError>,
impl<X> From<LogError> for Cis2Error<X> where
X: From<LogError>,
sourcefn from(err: LogError) -> Self
fn from(err: LogError) -> Self
Converts the error by wrapping it in Self::Custom.
sourceimpl<X> From<NewContractNameError> for Cis2Error<X> where
X: From<NewContractNameError>,
impl<X> From<NewContractNameError> for Cis2Error<X> where
X: From<NewContractNameError>,
sourcefn from(err: NewContractNameError) -> Self
fn from(err: NewContractNameError) -> Self
Converts the error by wrapping it in Self::Custom.
sourceimpl<X> From<NewReceiveNameError> for Cis2Error<X> where
X: From<NewReceiveNameError>,
impl<X> From<NewReceiveNameError> for Cis2Error<X> where
X: From<NewReceiveNameError>,
sourcefn from(err: NewReceiveNameError) -> Self
fn from(err: NewReceiveNameError) -> Self
Converts the error by wrapping it in Self::Custom.
sourceimpl<X> From<ParseError> for Cis2Error<X> where
X: From<ParseError>,
impl<X> From<ParseError> for Cis2Error<X> where
X: From<ParseError>,
sourcefn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts the error by wrapping it in Self::Custom.
sourceimpl<X> From<TransferError> for Cis2Error<X> where
X: From<TransferError>,
impl<X> From<TransferError> for Cis2Error<X> where
X: From<TransferError>,
sourcefn from(err: TransferError) -> Self
fn from(err: TransferError) -> Self
Converts the error by wrapping it in Self::Custom.
sourceimpl<R: PartialEq> PartialEq<Cis2Error<R>> for Cis2Error<R>
impl<R: PartialEq> PartialEq<Cis2Error<R>> for Cis2Error<R>
impl<R: Eq> Eq for Cis2Error<R>
impl<R> StructuralEq for Cis2Error<R>
impl<R> StructuralPartialEq for Cis2Error<R>
Auto Trait Implementations
impl<R> RefUnwindSafe for Cis2Error<R> where
R: RefUnwindSafe,
impl<R> Send for Cis2Error<R> where
R: Send,
impl<R> Sync for Cis2Error<R> where
R: Sync,
impl<R> Unpin for Cis2Error<R> where
R: Unpin,
impl<R> UnwindSafe for Cis2Error<R> where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more