objectstore_client/
error.rs

1/// Errors that can happen within the objectstore-client
2#[derive(Debug, thiserror::Error)]
3pub enum Error {
4    /// Any error emitted from the underlying [`reqwest`] client.
5    #[error(transparent)]
6    Reqwest(#[from] reqwest::Error),
7    /// IO errors related to payload streaming.
8    #[error(transparent)]
9    Io(#[from] std::io::Error),
10    /// Errors related to UTF-8 dcoding
11    #[error(transparent)]
12    Utf8(#[from] std::string::FromUtf8Error),
13    /// Errors handling metadata, such as serializing it to/from HTTP headers.
14    #[error(transparent)]
15    Metadata(#[from] objectstore_types::Error),
16    /// Error when scope validation fails.
17    #[error("{message}")]
18    InvalidScope {
19        /// The validation error message.
20        message: String,
21    },
22    /// Error when URL manipulation fails.
23    #[error("{message}")]
24    InvalidUrl {
25        /// The URL error message.
26        message: String,
27    },
28}
29
30/// A convenience alias that defaults our [`Error`] type.
31pub type Result<T, E = Error> = std::result::Result<T, E>;