ordinals_parser/
error.rs

1use thiserror::Error;
2
3/// Error type for ordinals-parser operations
4#[derive(Debug, Error)]
5pub enum Error {
6    /// Error during Bitcoin script parsing
7    #[error("Script error: {0}")]
8    ScriptError(String),
9
10    /// Error when the inscription format is invalid
11    #[error("Invalid inscription format: {0}")]
12    InvalidFormat(String),
13
14    /// Error when parsing an inscription ID
15    #[error("Invalid inscription ID: {0}")]
16    InvalidInscriptionId(String),
17
18    /// IO error
19    #[error("IO error: {0}")]
20    Io(#[from] std::io::Error),
21
22    /// Bitcoin-related error
23    #[error("Bitcoin error: {0}")]
24    Bitcoin(String),
25
26    /// Base64 decoding error
27    #[error("Base64 decoding error: {0}")]
28    Base64(#[from] base64::DecodeError),
29
30    /// Error related to CBOR encoding/decoding
31    #[error("CBOR error")]
32    Cbor,
33}
34
35/// Result type for ordinals-parser operations
36pub type Result<T> = std::result::Result<T, Error>;