datacake_node/
error.rs

1use std::fmt::Debug;
2use std::io;
3
4use thiserror::Error;
5
6use crate::nodes_selector::ConsistencyError;
7
8#[derive(Debug, Error)]
9pub enum NodeError {
10    #[error("{0}")]
11    /// An error has occurred within Chitchat.
12    ChitChat(String),
13
14    #[error("{0}")]
15    /// An IO error has occurred,
16    IO(#[from] io::Error),
17
18    #[error("{0}")]
19    /// An RPC error has occurred,
20    Rpc(#[from] datacake_rpc::Error),
21
22    #[error("Failed to complete operation due to consistency level failure: {0}")]
23    /// The operation succeeded on the local node but failed to meet the required
24    /// consistency level within the timeout period. (2 seconds)
25    Consistency(ConsistencyError),
26
27    #[error("Failed to initialised cluster extension: {0}")]
28    Extension(anyhow::Error),
29}