From 0c107bd32693fb33990d2bba54f0f9c94cb0b896 Mon Sep 17 00:00:00 2001 From: eum602 Date: Wed, 1 Nov 2023 16:45:25 -0500 Subject: [PATCH] fix: return 'invalid' instead of throwing when signer country code is not found Signed-off-by: eum602 --- src/services/validator/certificate_service.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/services/validator/certificate_service.rs b/src/services/validator/certificate_service.rs index cf15355..60f661c 100644 --- a/src/services/validator/certificate_service.rs +++ b/src/services/validator/certificate_service.rs @@ -619,10 +619,13 @@ pub async fn verify_base45( let signer_country_code_option = get_signer_country_code(&payload); if let None = signer_country_code_option { - let message = "country code not found"; + let message = "signer country code not found"; debug!("TRACE_ID: {}, DESCRIPTION ({})", trace_id, message); - return Responses::BadRequest(Json::from(ErrorMessage { - message, + return Responses::Sucess(Json::from(SuccessMessage { + data: HC1ValidationResponseDto { + is_valid: false, + ddcc_core_data_set, + }, trace_id: trace_id.to_string(), })); }