fix(errors): use Debug impl instead of Display for error types wrapping error_stack::Report (#714)

This commit is contained in:
Sanchith Hegde
2023-03-05 21:12:59 +05:30
committed by GitHub
parent 9062dc80ec
commit 45484752a2
9 changed files with 15 additions and 41 deletions

34
Cargo.lock generated
View File

@ -305,9 +305,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.68"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800"
[[package]]
name = "api_models"
@ -1482,12 +1482,11 @@ dependencies = [
[[package]]
name = "error-stack"
version = "0.2.4"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "859d224e04b2d93d974c08e375dac9b8d1a513846e44c6666450a57b1ed963f9"
checksum = "5f00447f331c7f726db5b8532ebc9163519eed03c6d7c8b73c90b3ff5646ac85"
dependencies = [
"anyhow",
"owo-colors",
"rustc_version",
]
@ -2098,12 +2097,6 @@ version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146"
[[package]]
name = "is_ci"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb"
[[package]]
name = "itertools"
version = "0.10.5"
@ -2664,15 +2657,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "owo-colors"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
dependencies = [
"supports-color",
]
[[package]]
name = "parking"
version = "2.0.0"
@ -3846,16 +3830,6 @@ version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
[[package]]
name = "supports-color"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f"
dependencies = [
"atty",
"is_ci",
]
[[package]]
name = "syn"
version = "1.0.107"

View File

@ -7,7 +7,7 @@ edition = "2021"
[dependencies]
actix-web = "4.3.0"
error-stack = "0.2.4"
error-stack = "0.3.1"
frunk = "0.4.1"
frunk_core = "0.4.1"
mime = "0.3.16"

View File

@ -10,7 +10,7 @@ license = "Apache-2.0"
[dependencies]
async-trait = "0.1.63"
bytes = "1.3.0"
error-stack = "0.2.4"
error-stack = "0.3.1"
futures = "0.3.25"
hex = "0.4.3"
nanoid = "0.4.0"

View File

@ -13,7 +13,7 @@ bb8 = "0.8"
clap = { version = "4.1.4", default-features = false, features = ["std", "derive", "help", "usage"] }
config = { version = "0.13.3", features = ["toml"] }
diesel = { version = "2.0.3", features = ["postgres", "serde_json", "time", "64-column-tables"] }
error-stack = "0.2.4"
error-stack = "0.3.1"
once_cell = "1.17.0"
serde = "1.0.152"
serde_json = "1.0.91"

View File

@ -5,7 +5,7 @@ use thiserror::Error;
pub enum DrainerError {
#[error("Error in parsing config : {0}")]
ConfigParsingError(String),
#[error("Error during redis operation : {0}")]
#[error("Error during redis operation : {0:?}")]
RedisError(error_stack::Report<redis::errors::RedisError>),
#[error("Application configuration error: {0}")]
ConfigurationError(config::ConfigError),

View File

@ -9,7 +9,7 @@ license = "Apache-2.0"
[dependencies]
async-trait = "0.1.63"
error-stack = "0.2.4"
error-stack = "0.3.1"
fred = { version = "5.2.0", features = ["metrics", "partial-tracing"] }
futures = "0.3"
serde = { version = "1.0.152", features = ["derive"] }

View File

@ -42,7 +42,7 @@ crc32fast = "1.3.2"
diesel = { version = "2.0.3", features = ["postgres", "serde_json", "time", "64-column-tables"] }
dyn-clone = "1.0.10"
encoding_rs = "0.8.31"
error-stack = "0.2.4"
error-stack = "0.3.1"
frunk = "0.4.1"
frunk_core = "0.4.1"
futures = "0.3.25"

View File

@ -50,7 +50,7 @@ macro_rules! impl_error_type {
#[derive(Debug, thiserror::Error)]
pub enum StorageError {
#[error("DatabaseError: {0}")]
#[error("DatabaseError: {0:?}")]
DatabaseError(error_stack::Report<storage_errors::DatabaseError>),
#[error("ValueNotFound: {0}")]
ValueNotFound(String),
@ -71,13 +71,13 @@ pub enum StorageError {
CustomerRedacted,
#[error("Deserialization failure")]
DeserializationFailed,
#[error("Received Error RedisError: {0}")]
ERedisError(error_stack::Report<RedisError>),
#[error("RedisError: {0:?}")]
RedisError(error_stack::Report<RedisError>),
}
impl From<error_stack::Report<RedisError>> for StorageError {
fn from(err: error_stack::Report<RedisError>) -> Self {
Self::ERedisError(err)
Self::RedisError(err)
}
}

View File

@ -13,7 +13,7 @@ kv_store = []
async-bb8-diesel = { git = "https://github.com/juspay/async-bb8-diesel", rev = "9a71d142726dbc33f41c1fd935ddaa79841c7be5" }
async-trait = "0.1.63"
diesel = { version = "2.0.3", features = ["postgres", "serde_json", "time", "64-column-tables"] }
error-stack = "0.2.4"
error-stack = "0.3.1"
frunk = "0.4.1"
frunk_core = "0.4.1"
hex = "0.4.3"