mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 02:57:02 +08:00
feat(analytics): implement currency conversion to power multi-currency aggregation (#6418)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -12,6 +12,8 @@ pub enum AnalyticsError {
|
||||
UnknownError,
|
||||
#[error("Access Forbidden Analytics Error")]
|
||||
AccessForbiddenError,
|
||||
#[error("Failed to fetch currency exchange rate")]
|
||||
ForexFetchFailed,
|
||||
}
|
||||
|
||||
impl ErrorSwitch<ApiErrorResponse> for AnalyticsError {
|
||||
@ -32,6 +34,12 @@ impl ErrorSwitch<ApiErrorResponse> for AnalyticsError {
|
||||
Self::AccessForbiddenError => {
|
||||
ApiErrorResponse::Unauthorized(ApiError::new("IR", 0, "Access Forbidden", None))
|
||||
}
|
||||
Self::ForexFetchFailed => ApiErrorResponse::InternalServerError(ApiError::new(
|
||||
"HE",
|
||||
0,
|
||||
"Failed to fetch currency exchange rate",
|
||||
None,
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user