garage_sdk/error/
types.rs1use thiserror::Error;
2
3#[derive(Error, Debug)]
5pub enum Error {
6 #[error("Configuration error: {message}")]
8 Config { message: String },
9
10 #[error("Invalid URL '{url}': {reason}")]
12 InvalidUrl { url: String, reason: String },
13
14 #[error("Failed to read file '{path}': {source}")]
16 FileRead {
17 path: String,
18 #[source]
19 source: std::io::Error,
20 },
21
22 #[error("Failed to download from '{url}': {reason}")]
24 Download { url: String, reason: String },
25
26 #[error("HTTP error: {0}")]
28 Http(#[from] reqwest::Error),
29
30 #[error("S3 operation failed: {operation} - {reason}")]
32 S3Operation { operation: String, reason: String },
33
34 #[error("Could not determine content type for '{filename}'")]
36 UnknownContentType { filename: String },
37
38 #[error("Invalid file path: {reason}")]
40 InvalidPath { reason: String },
41}
42
43pub type Result<T> = std::result::Result<T, Error>;