migrate to this error

it doesn't generate a bazillion warning at compile time
This commit is contained in:
trinity-1686a
2025-11-01 17:20:39 +01:00
parent 2e7a6fccba
commit 1fe932d07f
25 changed files with 177 additions and 214 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ garage_model.workspace = true
garage_util.workspace = true
garage_table.workspace = true
err-derive.workspace = true
thiserror.workspace = true
tracing.workspace = true
percent-encoding.workspace = true
+4 -4
View File
@@ -1,4 +1,4 @@
use err_derive::Error;
use thiserror::Error;
use hyper::header::HeaderValue;
use hyper::{HeaderMap, StatusCode};
@@ -8,15 +8,15 @@ use garage_api_common::generic_server::ApiError;
#[derive(Debug, Error)]
pub enum Error {
/// An error received from the API crate
#[error(display = "API error: {}", _0)]
#[error("API error: {0}")]
ApiError(garage_api_s3::error::Error),
/// The file does not exist
#[error(display = "Not found")]
#[error("Not found")]
NotFound,
/// The client sent a request without host, or with unsupported method
#[error(display = "Bad request: {}", _0)]
#[error("Bad request: {0}")]
BadRequest(String),
}