mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-09 22:19:23 +00:00
migrate to this error
it doesn't generate a bazillion warning at compile time
This commit is contained in:
+2
-2
@@ -33,7 +33,7 @@ async-trait.workspace = true
|
||||
serde.workspace = true
|
||||
serde_bytes.workspace = true
|
||||
serde_json.workspace = true
|
||||
err-derive = { workspace = true, optional = true }
|
||||
thiserror = { workspace = true, optional = true }
|
||||
|
||||
# newer version requires rust edition 2021
|
||||
kube = { workspace = true, optional = true }
|
||||
@@ -49,5 +49,5 @@ opentelemetry.workspace = true
|
||||
|
||||
[features]
|
||||
kubernetes-discovery = [ "kube", "k8s-openapi", "schemars" ]
|
||||
consul-discovery = [ "reqwest", "err-derive" ]
|
||||
consul-discovery = [ "reqwest", "thiserror" ]
|
||||
system-libs = [ "sodiumoxide/use-pkg-config" ]
|
||||
|
||||
+8
-8
@@ -3,7 +3,7 @@ use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::net::{IpAddr, SocketAddr};
|
||||
|
||||
use err_derive::Error;
|
||||
use thiserror::Error;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use garage_net::NodeID;
|
||||
@@ -219,12 +219,12 @@ impl ConsulDiscovery {
|
||||
/// Regroup all Consul discovery errors
|
||||
#[derive(Debug, Error)]
|
||||
pub enum ConsulError {
|
||||
#[error(display = "IO error: {}", _0)]
|
||||
Io(#[error(source)] std::io::Error),
|
||||
#[error(display = "HTTP error: {}", _0)]
|
||||
Reqwest(#[error(source)] reqwest::Error),
|
||||
#[error(display = "Invalid Consul TLS configuration")]
|
||||
#[error("IO error: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
#[error("HTTP error: {0}")]
|
||||
Reqwest(#[from] reqwest::Error),
|
||||
#[error("Invalid Consul TLS configuration")]
|
||||
InvalidTLSConfig,
|
||||
#[error(display = "Token error: {}", _0)]
|
||||
Token(#[error(source)] reqwest::header::InvalidHeaderValue),
|
||||
#[error("Token error: {0}")]
|
||||
Token(#[from] reqwest::header::InvalidHeaderValue),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user