build(deps): bump error-stack from version 0.3.1 to 0.4.1 (#4188)

This commit is contained in:
Sanchith Hegde
2024-04-01 12:31:17 +05:30
committed by GitHub
parent cb2000b088
commit ea730d4ffc
286 changed files with 1361 additions and 2397 deletions

View File

@ -1,7 +1,7 @@
use std::{fmt::Debug, sync::Arc};
use common_utils::errors::CustomResult;
use error_stack::IntoReport;
use error_stack::report;
use redis_interface::errors::RedisError;
use router_derive::TryGetEnumVariant;
use router_env::logger;
@ -136,7 +136,7 @@ where
.await
.and_then(|result| {
if result.is_empty() {
Err(RedisError::NotFound).into_report()
Err(report!(RedisError::NotFound))
} else {
Ok(result)
}
@ -159,7 +159,7 @@ where
.await?;
Ok(KvResult::HSetNx(result))
} else {
Err(RedisError::SetNxFailed).into_report()
Err(report!(RedisError::SetNxFailed))
}
}
@ -178,7 +178,7 @@ where
.await?;
Ok(KvResult::SetNx(result))
} else {
Err(RedisError::SetNxFailed).into_report()
Err(report!(RedisError::SetNxFailed))
}
}

View File

@ -1,4 +1,4 @@
use error_stack::{IntoReport, ResultExt};
use error_stack::ResultExt;
use redis_interface::{errors as redis_errors, PubsubInterface, RedisValue};
use router_env::logger;
@ -27,7 +27,6 @@ impl PubSubInterface for redis_interface::RedisConnectionPool {
self.subscriber
.subscribe(channel)
.await
.into_report()
.change_context(redis_errors::RedisError::SubscribeError)
}
@ -40,7 +39,6 @@ impl PubSubInterface for redis_interface::RedisConnectionPool {
self.publisher
.publish(channel, RedisValue::from(key).into_inner())
.await
.into_report()
.change_context(redis_errors::RedisError::SubscribeError)
}
@ -50,8 +48,7 @@ impl PubSubInterface for redis_interface::RedisConnectionPool {
let mut rx = self.subscriber.on_message();
while let Ok(message) = rx.recv().await {
logger::debug!("Invalidating {message:?}");
let key: CacheKind<'_> = match RedisValue::new(message.value)
.try_into()
let key = match CacheKind::try_from(RedisValue::new(message.value))
.change_context(redis_errors::RedisError::OnMessageError)
{
Ok(value) => value,