canic/spec/icrc/icrc21/
errors.rs

1use candid::{CandidType, Deserialize, Nat};
2use serde::Serialize;
3
4///
5/// ErrorInfo
6///
7
8#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
9pub struct ErrorInfo {
10    pub description: String,
11}
12
13///
14/// Icrc21Error
15///
16
17#[derive(CandidType, Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
18pub enum Icrc21Error {
19    UnsupportedCanisterCall(ErrorInfo),
20    ConsentMessageUnavailable(ErrorInfo),
21    InsufficientPayment(ErrorInfo),
22    GenericError {
23        error_code: Nat,
24        description: String,
25    },
26}