Skip to main content

yellowstone_fumarole_client/
error.rs

1pub use crate::core::runtime::{DataplaneErrorKind, DataplaneStreamError};
2
3pub type BoxedStdError = Box<dyn std::error::Error + Send + Sync + 'static>;
4
5#[derive(Debug, thiserror::Error)]
6pub enum InvalidMetadataHeader {
7    #[error("invalid metadata key '{key}'")]
8    InvalidMetadataKey {
9        key: String,
10        #[source]
11        source: Option<BoxedStdError>,
12    },
13    #[error("invalid metadata value for key '{key}'")]
14    InvalidMetadataValue {
15        key: String,
16        #[source]
17        source: Option<BoxedStdError>,
18    },
19}
20
21#[derive(Debug, thiserror::Error)]
22pub enum ConnectError {
23    #[error("invalid endpoint URI: {endpoint}")]
24    InvalidEndpoint {
25        endpoint: String,
26        #[source]
27        source: Option<BoxedStdError>,
28    },
29    #[error("failed to configure TLS")]
30    TlsConfiguration {
31        #[source]
32        source: Option<BoxedStdError>,
33    },
34    #[error("transport connection failed")]
35    Transport {
36        #[source]
37        source: Option<BoxedStdError>,
38    },
39}
40
41#[derive(Debug, thiserror::Error)]
42pub enum FumaroleSubscribeError {
43    #[error("control plane disconnected")]
44    ControlPlaneDisconnected,
45    #[error("control plane rejoin failed")]
46    ControlPlaneRejoinFailed {
47        #[source]
48        details: Option<BoxedStdError>,
49    },
50    #[error(transparent)]
51    DataPlaneStreamError(#[from] DataplaneStreamError),
52}