rcfe_core/
error.rs

1use thiserror::Error;
2use tonic::codegen::http::uri::InvalidUri;
3
4/// Core error type for rcfe-core crate
5/// # Variants
6/// * `InvalidUri` - Indicates that the provided URI is invalid
7/// * `TonicStatus` - Wraps errors from tonic status
8/// * `IllegalArgument` - Indicates that an illegal argument was provided
9#[derive(Error, Debug)]
10pub enum Error {
11    /// URI is invalid
12    #[error("Invalid URI: {0}")]
13    InvalidUri(#[from] InvalidUri),
14
15    /// Tonic status error
16    #[error("Tonic status error: {0}")]
17    TonicStatus(#[from] tonic::Status),
18
19    /// Illegal argument error
20    #[error("Illegal argument: {0}")]
21    IllegalArgument(String),
22
23    /// Bytes sequence parsing error
24    #[error("Byte sequence parsing error")]
25    ByteSequenceParseError,
26
27    /// InvalidTxnSequence
28    /// Indicates that the transaction sequence is invalid
29    /// # Arguments
30    /// * `String` - Description of the error
31    #[error("Invalid transaction sequence: {0}")]
32    InvalidTxnSequence(String),
33}