sui_indexer_alt_framework/ingestion/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

pub type Result<T> = std::result::Result<T, Error>;

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("Checkpoint {0} not found")]
    NotFound(u64),

    #[error("Failed to deserialize checkpoint {0}: {1}")]
    DeserializationError(u64, #[source] anyhow::Error),

    #[error("Failed to fetch checkpoint {0}: {1}")]
    FetchError(u64, #[source] anyhow::Error),

    #[error(transparent)]
    ReqwestError(#[from] reqwest::Error),

    #[error("No subscribers for ingestion service")]
    NoSubscribers,

    #[error("Shutdown signal received, stopping ingestion service")]
    Cancelled,

    #[error(transparent)]
    RpcClientError(#[from] tonic::Status),
}