Skip to main content

river_data_core/
error.rs

1#[cfg(feature = "client")]
2#[derive(Debug, thiserror::Error)]
3pub enum RiverDataClientError {
4    #[error("HTTP error: {0}")]
5    Http(#[from] reqwest::Error),
6    #[error("API error: {0}")]
7    Api(String),
8}
9
10#[cfg(feature = "client")]
11#[derive(Debug, thiserror::Error)]
12pub enum ControlPlaneError {
13    #[error("HTTP error: {0}")]
14    Http(#[from] reqwest::Error),
15    #[error("API error: {status} from {url}: {body}")]
16    Api {
17        status: u16,
18        url: String,
19        body: String,
20    },
21    #[error("Enrollment failed: credentials revoked or invalid")]
22    CredentialsRevoked,
23}