1use std::borrow::Cow;
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum Error {
8 #[error("{0}, {1}: {2} (path = {3})")]
9 Remote(
10 http::StatusCode,
11 Cow<'static, str>,
12 Cow<'static, str>,
13 Cow<'static, str>,
14 ),
15 #[error("received invalid response: {0}")]
16 InvalidResponse(Cow<'static, str>),
17 #[error("not found")]
18 NotFound,
19 #[error("io error: {0}")]
20 IoError(#[from] std::io::Error),
21 #[error("http error: {0}")]
22 Http(#[from] http::Error),
23 #[error("hyper error: {0}")]
24 Hyper(#[from] hyper::Error),
25 #[error("invalid header: {0}")]
26 Header(#[from] hyper::header::ToStrError),
27 #[error("deserialization error: {0}")]
28 Deserialization(#[from] serde_json::Error),
29 #[error("invalid signature parameters: {0}")]
30 SignParameters(#[from] aws_sigv4::signing_params::BuildError),
31 #[error("could not sign request: {0}")]
32 SignRequest(#[from] aws_sigv4::http_request::SigningError),
33 #[error("request timed out")]
34 Timeout,
35 #[error("{0}")]
36 Message(Cow<'static, str>),
37}