mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat: add track_caller to functions that perform change_context (#592)
This commit is contained in:
@ -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>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user