1pub type Result<T, E = Error> = std::result::Result<T, E>;
2
3#[derive(thiserror::Error, Debug)]
4pub enum Error {
5 #[error("Reqwest error: {0}")]
6 ReqwestError(#[from] reqwest::Error),
7
8 #[error("Generic error: {source}")]
9 Generic {
10 source: Box<dyn std::error::Error + Send + Sync + 'static>,
12 },
13
14 #[error("Object not found: {source}")]
16 NotFound {
17 source: Box<dyn std::error::Error + Send + Sync + 'static>,
19 },
20
21 #[error("Object at location already exists: {source}")]
23 AlreadyExists {
24 source: Box<dyn std::error::Error + Send + Sync + 'static>,
26 },
27
28 #[error("Request precondition failure: {source}")]
30 Precondition {
31 source: Box<dyn std::error::Error + Send + Sync + 'static>,
33 },
34
35 #[error("Object not modified: {source}")]
37 NotModified {
38 source: Box<dyn std::error::Error + Send + Sync + 'static>,
40 },
41
42 #[error("The operation lacked the necessary privileges to complete: {source}")]
45 PermissionDenied {
46 source: Box<dyn std::error::Error + Send + Sync + 'static>,
48 },
49
50 #[error("The operation lacked valid authentication credentials: {source}")]
52 Unauthenticated {
53 source: Box<dyn std::error::Error + Send + Sync + 'static>,
55 },
56
57 #[error("Configuration key: '{}' is not valid.", key)]
59 UnknownConfigurationKey {
60 key: String,
62 },
63
64 #[error("Invalid HTTP header value: {0}")]
66 InvalidHeader(#[from] reqwest::header::InvalidHeaderValue),
67
68 #[error("Failed to write recording: {0}")]
70 RecordingIo(#[from] std::io::Error),
71
72 #[error("System clock error: time is before Unix epoch")]
74 ClockError,
75}