Skip to main content

taproot_assets_types/
error.rs

1use crate::alloc::string::String; // For no_std compatibility
2use bitcoin::io::Error as BitcoinIoError;
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum Error {
7    #[error("I/O error: {0}")]
8    Io(BitcoinIoError),
9
10    #[error("TLV stream error: {0}")]
11    TlvStream(String),
12
13    #[error("Missing TLV field: {0}")]
14    MissingTlvField(String),
15
16    #[error("Bitcoin serialization error: {0}")]
17    BitcoinSerialization(String),
18
19    #[error("Unknown TLV type: {0}")]
20    UnknownTlvType(u64),
21
22    #[error("Invalid TLV value for type {0}: {1}")]
23    InvalidTlvValue(u64, String),
24}