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 236af3a958
commit 82297371bf
25 changed files with 172 additions and 209 deletions
+5 -8
View File
@@ -1,6 +1,6 @@
use std::convert::TryFrom;
use err_derive::Error;
use thiserror::Error;
use hyper::header::HeaderValue;
use hyper::{HeaderMap, StatusCode};
@@ -16,20 +16,17 @@ use garage_api_common::helpers::*;
/// Errors of this crate
#[derive(Debug, Error)]
pub enum Error {
#[error(display = "{}", _0)]
#[error("{0}")]
/// Error from common error
Common(#[error(source)] CommonError),
Common(#[from] CommonError),
// Category: cannot process
/// The API access key does not exist
#[error(display = "Access key not found: {}", _0)]
#[error("Access key not found: {0}")]
NoSuchAccessKey(String),
/// In Import key, the key already exists
#[error(
display = "Key {} already exists in data store. Even if it is deleted, we can't let you create a new key with the same ID. Sorry.",
_0
)]
#[error("Key {0} already exists in data store. Even if it is deleted, we can't let you create a new key with the same ID. Sorry.")]
KeyAlreadyExists(String),
}