sui_indexer_alt_framework/ingestion/
error.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4pub type Result<T> = std::result::Result<T, Error>;
5
6#[derive(thiserror::Error, Debug)]
7pub enum Error {
8    #[error("Checkpoint {0} not found")]
9    NotFound(u64),
10
11    #[error("Failed to deserialize checkpoint {0}: {1}")]
12    DeserializationError(u64, #[source] anyhow::Error),
13
14    #[error("Failed to fetch checkpoint {0}: {1}")]
15    FetchError(u64, #[source] anyhow::Error),
16
17    #[error(transparent)]
18    ReqwestError(#[from] reqwest::Error),
19
20    #[error("No subscribers for ingestion service")]
21    NoSubscribers,
22
23    #[error("Shutdown signal received, stopping ingestion service")]
24    Cancelled,
25
26    #[error(transparent)]
27    RpcClientError(#[from] tonic::Status),
28}