forked from durch/rust-s3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.rs
More file actions
36 lines (35 loc) · 1.14 KB
/
error.rs
File metadata and controls
36 lines (35 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
use thiserror::Error;
#[derive(Error, Debug)]
pub enum CredentialsError {
#[error("Not an AWS instance")]
NotEc2,
#[error("Not a container")]
NotContainer,
#[error("Config not found")]
ConfigNotFound,
#[error("Missing aws_access_key_id section in config")]
ConfigMissingAccessKeyId,
#[error("Missing aws_access_key_id section in config")]
ConfigMissingSecretKey,
#[error("Neither {0}, nor {1} exists in the environment")]
MissingEnvVar(String, String),
#[cfg(feature = "http-credentials")]
#[error("attohttpc: {0}")]
Atto(#[from] attohttpc::Error),
#[error("ini: {0}")]
Ini(#[from] ini::Error),
#[error("serde_xml: {0}")]
SerdeXml(#[from] quick_xml::de::DeError),
#[error("url parse: {0}")]
UrlParse(#[from] url::ParseError),
#[error("io: {0}")]
Io(#[from] std::io::Error),
#[error("env var: {0}")]
Env(#[from] std::env::VarError),
#[error("Invalid home dir")]
HomeDir,
#[error("Could not get valid credentials from STS, ENV, Profile or Instance metadata")]
NoCredentials,
#[error("unexpected status code: {0}")]
UnexpectedStatusCode(u16),
}