hypersync_format/
error.rs1use std::result::Result as StdResult;
2use thiserror::Error as ThisError;
3
4#[derive(Debug, ThisError)]
5pub enum Error {
6 #[error("Unexpected length. Expected {expected} got {got}.")]
7 UnexpectedLength { expected: usize, got: usize },
8 #[error("Failed to decode hex string:\n{0}")]
9 DecodeHex(faster_hex::Error),
10 #[error("Invalid hex prefix. Hex string doesn't start with \"0x\". Value was: \"{0}\"")]
11 InvalidHexPrefix(String),
12 #[error("Unknown transaction status: {0}")]
13 UnknownTransactionStatus(String),
14 #[error("Unknown transaction type: {0}")]
15 UnknownTransactionType(String),
16 #[error("Unexpected quantity. Value was: {0}")]
17 UnexpectedQuantity(String),
18 #[error("Invalid Number from Hex. {0}")]
19 DecodeNumberFromHex(String),
20 #[error("Invalid Bloom Filter from bytes")]
21 BloomFilterFromBytes,
22}
23
24pub type Result<T> = StdResult<T, Error>;