algokit_transact/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//! Error types for the AlgoKit Core transact module.
//!
//! This module defines the various error types that can occur during Algorand
//! transaction processing, including encoding/decoding errors, validation errors,
//! and other transaction-related failures.

use thiserror::Error;

/// Represents errors that can occur during Algorand transaction operations.
///
/// This enum encompasses various failure scenarios that may arise when creating,
/// manipulating, serializing, or deserializing Algorand transactions.
#[derive(Debug, Error)]
pub enum AlgoKitTransactError {
    #[error("Error ocurred during encoding: {0}")]
    EncodingError(#[from] rmp_serde::encode::Error),

    #[error("Error ocurred during decoding: {0}")]
    DecodingError(#[from] rmp_serde::decode::Error),

    #[error("Error ocurred during msgpack encoding: {0}")]
    MsgpackEncodingError(#[from] rmpv::encode::Error),

    #[error("Error ocurred during msgpack decoding: {0}")]
    MsgpackDecodingError(#[from] rmpv::decode::Error),

    #[error("Unknown transaction type: {0}")]
    UnknownTransactionType(String),

    #[error("{0}")]
    InputError(String),

    #[error("{0}")]
    InvalidAddress(String),
}