mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	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:
		| @ -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, | ||||
|         } | ||||
|     } | ||||
|  | ||||
|  | ||||
| @ -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", | ||||
|         } | ||||
|     } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Prajjwal Kumar
					Prajjwal Kumar