refactor(blocklist): separate utility function & kill switch for validating data in blocklist (#3360)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prajjwal Kumar
2024-02-06 19:06:47 +05:30
committed by GitHub
parent ebe4ac30a8
commit 0a97a1eb63
20 changed files with 557 additions and 211 deletions

View File

@ -17,6 +17,7 @@ impl actix_web::ResponseError for ApiErrorResponse {
Self::MethodNotAllowed(_) => StatusCode::METHOD_NOT_ALLOWED,
Self::NotFound(_) => StatusCode::NOT_FOUND,
Self::BadRequest(_) => StatusCode::BAD_REQUEST,
Self::DomainError(_) => StatusCode::OK,
}
}

View File

@ -94,6 +94,7 @@ pub enum ApiErrorResponse {
NotFound(ApiError),
MethodNotAllowed(ApiError),
BadRequest(ApiError),
DomainError(ApiError),
}
impl ::core::fmt::Display for ApiErrorResponse {
@ -122,6 +123,7 @@ impl ApiErrorResponse {
| Self::NotFound(i)
| Self::MethodNotAllowed(i)
| Self::BadRequest(i)
| Self::DomainError(i)
| Self::ConnectorError(i, _) => i,
}
}
@ -139,6 +141,7 @@ impl ApiErrorResponse {
| Self::NotFound(i)
| Self::MethodNotAllowed(i)
| Self::BadRequest(i)
| Self::DomainError(i)
| Self::ConnectorError(i, _) => i,
}
}
@ -156,6 +159,7 @@ impl ApiErrorResponse {
| Self::NotFound(_)
| Self::BadRequest(_) => "invalid_request",
Self::InternalServerError(_) => "api",
Self::DomainError(_) => "blocked",
Self::ConnectorError(_, _) => "connector",
}
}