mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-09 14:19:22 +00:00
migrate to this error
it doesn't generate a bazillion warning at compile time
This commit is contained in:
+1
-1
@@ -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
@@ -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),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user