2022-05-18 20:24:09 +00:00
|
|
|
use std::borrow::Cow;
|
|
|
|
|
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
/// Errors returned by this crate
|
|
|
|
#[derive(Error, Debug)]
|
|
|
|
pub enum Error {
|
2022-05-24 10:48:05 +00:00
|
|
|
#[error("{0}, {1}: {2} (path = {3})")]
|
|
|
|
Remote(
|
|
|
|
http::StatusCode,
|
|
|
|
Cow<'static, str>,
|
|
|
|
Cow<'static, str>,
|
|
|
|
Cow<'static, str>,
|
|
|
|
),
|
2022-05-18 20:24:09 +00:00
|
|
|
#[error("received invalid response: {0}")]
|
|
|
|
InvalidResponse(Cow<'static, str>),
|
|
|
|
#[error("not found")]
|
|
|
|
NotFound,
|
|
|
|
#[error("io error: {0}")]
|
|
|
|
IoError(#[from] std::io::Error),
|
2023-05-18 11:04:17 +00:00
|
|
|
#[error("http error: {0}")]
|
|
|
|
Http(#[from] http::Error),
|
|
|
|
#[error("hyper error: {0}")]
|
|
|
|
Hyper(#[from] hyper::Error),
|
|
|
|
#[error("invalid header: {0}")]
|
|
|
|
Header(#[from] hyper::header::ToStrError),
|
2022-05-18 20:24:09 +00:00
|
|
|
#[error("deserialization error: {0}")]
|
|
|
|
Deserialization(#[from] serde_json::Error),
|
2023-05-18 11:04:17 +00:00
|
|
|
#[error("invalid signature parameters: {0}")]
|
2024-02-05 13:02:45 +00:00
|
|
|
SignParameters(#[from] aws_sigv4::sign::v4::signing_params::BuildError),
|
2023-05-18 11:04:17 +00:00
|
|
|
#[error("could not sign request: {0}")]
|
|
|
|
SignRequest(#[from] aws_sigv4::http_request::SigningError),
|
|
|
|
#[error("request timed out")]
|
|
|
|
Timeout,
|
2022-05-18 20:24:09 +00:00
|
|
|
#[error("{0}")]
|
|
|
|
Message(Cow<'static, str>),
|
|
|
|
}
|