mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-07 23:48:49 +08:00
feat(api): use ApiClient trait in AppState (#2067)
This commit is contained in:
@ -194,6 +194,9 @@ pub enum ApplicationError {
|
||||
|
||||
#[error("I/O: {0}")]
|
||||
IoError(std::io::Error),
|
||||
|
||||
#[error("Error while constructing api client: {0}")]
|
||||
ApiClientError(ApiClientError),
|
||||
}
|
||||
|
||||
impl From<MetricsError> for ApplicationError {
|
||||
@ -232,7 +235,8 @@ impl ResponseError for ApplicationError {
|
||||
Self::MetricsError(_)
|
||||
| Self::IoError(_)
|
||||
| Self::ConfigurationError(_)
|
||||
| Self::InvalidConfigurationValueError(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
| Self::InvalidConfigurationValueError(_)
|
||||
| Self::ApiClientError(_) => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,7 +252,7 @@ pub fn http_not_implemented() -> actix_web::HttpResponse<BoxBody> {
|
||||
.error_response()
|
||||
}
|
||||
|
||||
#[derive(Debug, thiserror::Error, PartialEq)]
|
||||
#[derive(Debug, thiserror::Error, PartialEq, Clone)]
|
||||
pub enum ApiClientError {
|
||||
#[error("Header map construction failed")]
|
||||
HeaderMapConstructionFailed,
|
||||
|
||||
Reference in New Issue
Block a user