mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +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};
|
use crate::{core::errors, logger};
|
||||||
|
|
||||||
pub trait StorageErrorExt {
|
pub trait StorageErrorExt {
|
||||||
|
#[track_caller]
|
||||||
fn to_not_found_response(
|
fn to_not_found_response(
|
||||||
self,
|
self,
|
||||||
not_found_response: errors::ApiErrorResponse,
|
not_found_response: errors::ApiErrorResponse,
|
||||||
) -> error_stack::Report<errors::ApiErrorResponse>;
|
) -> error_stack::Report<errors::ApiErrorResponse>;
|
||||||
|
|
||||||
|
#[track_caller]
|
||||||
fn to_duplicate_response(
|
fn to_duplicate_response(
|
||||||
self,
|
self,
|
||||||
duplicate_response: errors::ApiErrorResponse,
|
duplicate_response: errors::ApiErrorResponse,
|
||||||
@ -41,8 +43,11 @@ impl StorageErrorExt for error_stack::Report<errors::StorageError> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub trait ConnectorErrorExt {
|
pub trait ConnectorErrorExt {
|
||||||
|
#[track_caller]
|
||||||
fn to_refund_failed_response(self) -> error_stack::Report<errors::ApiErrorResponse>;
|
fn to_refund_failed_response(self) -> error_stack::Report<errors::ApiErrorResponse>;
|
||||||
|
#[track_caller]
|
||||||
fn to_payment_failed_response(self) -> error_stack::Report<errors::ApiErrorResponse>;
|
fn to_payment_failed_response(self) -> error_stack::Report<errors::ApiErrorResponse>;
|
||||||
|
#[track_caller]
|
||||||
fn to_verify_failed_response(self) -> error_stack::Report<errors::ApiErrorResponse>;
|
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 {
|
pub trait RedisErrorExt {
|
||||||
|
#[track_caller]
|
||||||
fn to_redis_failed_response(self, key: &str) -> error_stack::Report<errors::StorageError>;
|
fn to_redis_failed_response(self, key: &str) -> error_stack::Report<errors::StorageError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user