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,4 +1,4 @@
use error_stack::IntoReport;
use error_stack::report;
use router_env::{instrument, tracing};
#[cfg(feature = "accounts_cache")]
use storage_impl::redis::cache::CacheKind;
@ -62,8 +62,7 @@ impl ApiKeyInterface for Store {
api_key
.insert(&conn)
.await
.map_err(Into::into)
.into_report()
.map_err(|error| report!(errors::StorageError::from(error)))
}
#[instrument(skip_all)]
@ -79,8 +78,7 @@ impl ApiKeyInterface for Store {
let update_call = || async {
storage::ApiKey::update_by_merchant_id_key_id(&conn, merchant_id, key_id, api_key)
.await
.map_err(Into::into)
.into_report()
.map_err(|error| report!(errors::StorageError::from(error)))
};
#[cfg(not(feature = "accounts_cache"))]
@ -101,8 +99,7 @@ impl ApiKeyInterface for Store {
&_key_id,
)
.await
.map_err(Into::into)
.into_report()?
.map_err(|error| report!(errors::StorageError::from(error)))?
.ok_or(report!(errors::StorageError::ValueNotFound(format!(
"ApiKey of {_key_id} not found"
))))?;
@ -126,8 +123,7 @@ impl ApiKeyInterface for Store {
let delete_call = || async {
storage::ApiKey::revoke_by_merchant_id_key_id(&conn, merchant_id, key_id)
.await
.map_err(Into::into)
.into_report()
.map_err(|error| report!(errors::StorageError::from(error)))
};
#[cfg(not(feature = "accounts_cache"))]
{
@ -145,8 +141,7 @@ impl ApiKeyInterface for Store {
let api_key =
storage::ApiKey::find_optional_by_merchant_id_key_id(&conn, merchant_id, key_id)
.await
.map_err(Into::into)
.into_report()?
.map_err(|error| report!(errors::StorageError::from(error)))?
.ok_or(report!(errors::StorageError::ValueNotFound(format!(
"ApiKey of {key_id} not found"
))))?;
@ -169,8 +164,7 @@ impl ApiKeyInterface for Store {
let conn = connection::pg_connection_read(self).await?;
storage::ApiKey::find_optional_by_merchant_id_key_id(&conn, merchant_id, key_id)
.await
.map_err(Into::into)
.into_report()
.map_err(|error| report!(errors::StorageError::from(error)))
}
#[instrument(skip_all)]
@ -183,8 +177,7 @@ impl ApiKeyInterface for Store {
let conn = connection::pg_connection_read(self).await?;
storage::ApiKey::find_optional_by_hashed_api_key(&conn, hashed_api_key)
.await
.map_err(Into::into)
.into_report()
.map_err(|error| report!(errors::StorageError::from(error)))
};
#[cfg(not(feature = "accounts_cache"))]
@ -214,8 +207,7 @@ impl ApiKeyInterface for Store {
let conn = connection::pg_connection_read(self).await?;
storage::ApiKey::find_by_merchant_id(&conn, merchant_id, limit, offset)
.await
.map_err(Into::into)
.into_report()
.map_err(|error| report!(errors::StorageError::from(error)))
}
}