use std::sync::Arc;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
Reqwest(#[from] reqwest::Error),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Utf8(#[from] std::string::FromUtf8Error),
#[error(transparent)]
Metadata(#[from] objectstore_types::metadata::Error),
#[error("invalid scope: {0}")]
InvalidScope(#[from] objectstore_types::scope::InvalidScopeError),
#[error(transparent)]
TokenError(#[from] jsonwebtoken::errors::Error),
#[error("{message}")]
InvalidUrl {
message: String,
},
#[error(transparent)]
Multipart(#[from] multer::Error),
#[error("{0}")]
MalformedResponse(String),
#[error("batch request failed: {0}")]
Batch(Arc<Error>),
#[error("operation failed with HTTP status code {status}: {message}")]
OperationFailure {
status: u16,
message: String,
},
}
pub type Result<T, E = Error> = std::result::Result<T, E>;