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).
Sender is unauthorized to call this function (Error code: -42000003).
Custom(R)
Custom error
Trait Implementations§
source§impl<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>>,
source§fn from(err: CallContractError<T>) -> Self
fn from(err: CallContractError<T>) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<CheckAccountSignatureError> for Cis2Error<X>where
X: From<CheckAccountSignatureError>,
impl<X> From<CheckAccountSignatureError> for Cis2Error<X>where
X: From<CheckAccountSignatureError>,
source§fn from(err: CheckAccountSignatureError) -> Self
fn from(err: CheckAccountSignatureError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<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.
source§impl<X> From<LogError> for Cis2Error<X>
impl<X> From<LogError> for Cis2Error<X>
source§fn from(err: LogError) -> Self
fn from(err: LogError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<NewContractNameError> for Cis2Error<X>where
X: From<NewContractNameError>,
impl<X> From<NewContractNameError> for Cis2Error<X>where
X: From<NewContractNameError>,
source§fn from(err: NewContractNameError) -> Self
fn from(err: NewContractNameError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<NewReceiveNameError> for Cis2Error<X>where
X: From<NewReceiveNameError>,
impl<X> From<NewReceiveNameError> for Cis2Error<X>where
X: From<NewReceiveNameError>,
source§fn from(err: NewReceiveNameError) -> Self
fn from(err: NewReceiveNameError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<ParseError> for Cis2Error<X>where
X: From<ParseError>,
impl<X> From<ParseError> for Cis2Error<X>where
X: From<ParseError>,
source§fn from(err: ParseError) -> Self
fn from(err: ParseError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<QueryAccountBalanceError> for Cis2Error<X>where
X: From<QueryAccountBalanceError>,
impl<X> From<QueryAccountBalanceError> for Cis2Error<X>where
X: From<QueryAccountBalanceError>,
source§fn from(err: QueryAccountBalanceError) -> Self
fn from(err: QueryAccountBalanceError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<QueryAccountPublicKeysError> for Cis2Error<X>where
X: From<QueryAccountPublicKeysError>,
impl<X> From<QueryAccountPublicKeysError> for Cis2Error<X>where
X: From<QueryAccountPublicKeysError>,
source§fn from(err: QueryAccountPublicKeysError) -> Self
fn from(err: QueryAccountPublicKeysError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<QueryContractBalanceError> for Cis2Error<X>where
X: From<QueryContractBalanceError>,
impl<X> From<QueryContractBalanceError> for Cis2Error<X>where
X: From<QueryContractBalanceError>,
source§fn from(err: QueryContractBalanceError) -> Self
fn from(err: QueryContractBalanceError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<TransferError> for Cis2Error<X>where
X: From<TransferError>,
impl<X> From<TransferError> for Cis2Error<X>where
X: From<TransferError>,
source§fn from(err: TransferError) -> Self
fn from(err: TransferError) -> Self
Converts the error by wrapping it in Self::Custom.
source§impl<X> From<UpgradeError> for Cis2Error<X>where
X: From<UpgradeError>,
impl<X> From<UpgradeError> for Cis2Error<X>where
X: From<UpgradeError>,
source§fn from(err: UpgradeError) -> Self
fn from(err: UpgradeError) -> Self
Converts the error by wrapping it in Self::Custom.