Skip to main content

resourcespace_client/
error.rs

1use thiserror::Error;
2
3// TODO: what errors can RS return?
4
5#[non_exhaustive]
6#[derive(Debug, Error)]
7pub enum RsError {
8    #[error("API error {status}: {message}")]
9    Api { status: u16, message: String },
10
11    #[error("Operation returned false")]
12    OperationFailed,
13
14    #[error("HTTP error: {0}")]
15    Http(#[from] reqwest::Error),
16
17    #[error("Other error: {0}")]
18    Other(String),
19
20    #[error("Validation error: {0}")]
21    Validation(String),
22}