1use zaino_fetch::jsonrpsee::error::TransportError;
4use zaino_serve::server::error::ServerError;
5
6#[allow(deprecated)]
7use zaino_state::{FetchServiceError, StateServiceError};
8
9#[derive(Debug, thiserror::Error)]
11#[allow(deprecated)]
12pub enum IndexerError {
13 #[error("Server error: {0}")]
15 ServerError(#[from] ServerError),
16 #[error("Configuration error: {0}")]
18 ConfigError(String),
19 #[error("JSON RPSee connector error: {0}")]
21 TransportError(#[from] TransportError),
22 #[error("FetchService error: {0}")]
24 FetchServiceError(Box<FetchServiceError>),
25 #[error("StateService error: {0}")]
27 StateServiceError(Box<StateServiceError>),
28 #[error("HTTP error: Invalid URI {0}")]
30 HttpError(#[from] http::Error),
31 #[error("Join handle error: Invalid URI {0}")]
33 TokioJoinError(#[from] tokio::task::JoinError),
34 #[error("Misc indexer error: {0}")]
36 MiscIndexerError(String),
37 #[error("Restart Zaino")]
39 Restart,
40}
41
42#[allow(deprecated)]
43impl From<StateServiceError> for IndexerError {
44 fn from(value: StateServiceError) -> Self {
45 IndexerError::StateServiceError(Box::new(value))
46 }
47}
48
49#[allow(deprecated)]
50impl From<FetchServiceError> for IndexerError {
51 fn from(value: FetchServiceError) -> Self {
52 IndexerError::FetchServiceError(Box::new(value))
53 }
54}