feat: add track_caller to functions that perform change_context (#592)

This commit is contained in:
Nishant Joshi
2023-02-15 14:28:07 +05:30
committed by GitHub
parent f1e3bf4895
commit 8d2e573a29

View File

@ -1,11 +1,13 @@
use crate::{core::errors, logger};
pub trait StorageErrorExt {
#[track_caller]
fn to_not_found_response(
self,
not_found_response: errors::ApiErrorResponse,
) -> error_stack::Report<errors::ApiErrorResponse>;
#[track_caller]
fn to_duplicate_response(
self,
duplicate_response: errors::ApiErrorResponse,
@ -41,8 +43,11 @@ impl StorageErrorExt for error_stack::Report<errors::StorageError> {
}
pub trait ConnectorErrorExt {
#[track_caller]
fn to_refund_failed_response(self) -> error_stack::Report<errors::ApiErrorResponse>;
#[track_caller]
fn to_payment_failed_response(self) -> error_stack::Report<errors::ApiErrorResponse>;
#[track_caller]
fn to_verify_failed_response(self) -> error_stack::Report<errors::ApiErrorResponse>;
}
@ -121,6 +126,7 @@ impl ConnectorErrorExt for error_stack::Report<errors::ConnectorError> {
}
pub trait RedisErrorExt {
#[track_caller]
fn to_redis_failed_response(self, key: &str) -> error_stack::Report<errors::StorageError>;
}