hopr_primitive_types/
errors.rs1use serde::{Deserialize, Serialize};
2use thiserror::Error;
3
4pub type AnyError = Box<dyn std::error::Error + Send + Sync + 'static>;
7
8#[derive(Error, Debug, Serialize, Deserialize, PartialEq)]
10pub enum GeneralError {
11 #[error("failed to parse/deserialize the data: {0}")]
12 ParseError(String),
13
14 #[error("input argument to the function is invalid")]
15 InvalidInput,
16
17 #[error("non-specific error: {0}")]
18 NonSpecificError(String),
19}
20
21pub type Result<T> = core::result::Result<T, GeneralError>;