lit_node_core/error.rs
1use thiserror::Error;
2
3/// Errors that occur in this crate
4#[derive(Debug, Error)]
5pub enum Error {
6 #[error("Parse error {0}")]
7 Parse(String),
8 #[error("Invalid type error {0}")]
9 InvalidType(String),
10}
11
12/// Results returned in this crate
13pub type Result<T> = std::result::Result<T, Error>;
14
15impl From<hex::FromHexError> for Error {
16 fn from(e: hex::FromHexError) -> Self {
17 Self::Parse(e.to_string())
18 }
19}