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 #[cfg(feature = "prometheus")]
39 #[error("Metrics error: {0}")]
40 MetricsError(String),
41 #[error("Restart Zaino")]
43 Restart,
44}
45
46#[allow(deprecated)]
47impl From<StateServiceError> for IndexerError {
48 fn from(value: StateServiceError) -> Self {
49 IndexerError::StateServiceError(Box::new(value))
50 }
51}
52
53#[allow(deprecated)]
54impl From<FetchServiceError> for IndexerError {
55 fn from(value: FetchServiceError) -> Self {
56 IndexerError::FetchServiceError(Box::new(value))
57 }
58}