1use zaino_serve::server::error::ServerError;
4
5use zaino_state::NodeBackedIndexerServiceError;
6
7#[derive(Debug, thiserror::Error)]
9pub enum IndexerError {
10 #[error("Server error: {0}")]
12 ServerError(#[from] ServerError),
13 #[error("Configuration error: {0}")]
15 ConfigError(String),
16 #[error("validator probe error: {0}")]
18 ProbeError(#[from] zaino_rpc::ProbeError),
19 #[error("NodeBackedIndexerService error: {0}")]
21 NodeBackedIndexerServiceError(Box<NodeBackedIndexerServiceError>),
22 #[error("HTTP error: Invalid URI {0}")]
24 HttpError(#[from] http::Error),
25 #[error("Join handle error: Invalid URI {0}")]
27 TokioJoinError(#[from] tokio::task::JoinError),
28 #[error("Misc indexer error: {0}")]
30 MiscIndexerError(String),
31 #[cfg(feature = "prometheus")]
33 #[error("Metrics error: {0}")]
34 MetricsError(String),
35 #[error("Restart Zaino")]
37 Restart,
38}
39
40impl From<NodeBackedIndexerServiceError> for IndexerError {
41 fn from(value: NodeBackedIndexerServiceError) -> Self {
42 IndexerError::NodeBackedIndexerServiceError(Box::new(value))
43 }
44}