From f0244f2111c23eec5e069bad862295ab5038c75b Mon Sep 17 00:00:00 2001 From: Yogender Kumar Date: Tue, 14 Oct 2025 10:16:43 +0530 Subject: [PATCH] resolved bug UNP-2147 displayed error message in creation existing center type --- .../kernel/masterdata/constant/ApplicationErrorCode.java | 3 ++- .../service/impl/RegistrationCenterTypeServiceImpl.java | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/constant/ApplicationErrorCode.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/constant/ApplicationErrorCode.java index 56532fdb098..50179b3cfa7 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/constant/ApplicationErrorCode.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/constant/ApplicationErrorCode.java @@ -11,7 +11,8 @@ public enum ApplicationErrorCode { APPLICATION_INSERT_EXCEPTION("KER-MSD-101", "Error occurred while inserting application details"), APPLICATION_NOT_FOUND_EXCEPTION("KER-MSD-002", "Application not found"), APPLICATION_REQUEST_EXCEPTION("KER-MSD-201", "Bad Request Found"), - APPLICATION_CONFIG_FETCH_EXCEPTION("KER-MSD-193", "Error occurred while fetching Application config"); + APPLICATION_CONFIG_FETCH_EXCEPTION("KER-MSD-193", "Error occurred while fetching Application config"), + DATA_ALREADY_EXIST_EXCEPTION("KER-MSD-APT", "Center Type already exist"); private final String errorCode; diff --git a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/RegistrationCenterTypeServiceImpl.java b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/RegistrationCenterTypeServiceImpl.java index 1a4c6e9a547..7a14cd470eb 100644 --- a/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/RegistrationCenterTypeServiceImpl.java +++ b/admin/kernel-masterdata-service/src/main/java/io/mosip/kernel/masterdata/service/impl/RegistrationCenterTypeServiceImpl.java @@ -131,10 +131,11 @@ public CodeAndLanguageCodeID createRegistrationCenterType( ApplicationErrorCode.APPLICATION_INSERT_EXCEPTION.getErrorMessage() + ExceptionUtils.parseException(exception)), "ADM-556"); - throw new MasterDataServiceException(ApplicationErrorCode.APPLICATION_INSERT_EXCEPTION.getErrorCode(), - ApplicationErrorCode.APPLICATION_INSERT_EXCEPTION.getErrorMessage() + throw new MasterDataServiceException( + ApplicationErrorCode.DATA_ALREADY_EXIST_EXCEPTION.getErrorCode(), + ApplicationErrorCode.DATA_ALREADY_EXIST_EXCEPTION.getErrorMessage() + ExceptionUtils.parseException(exception)); - } + } CodeAndLanguageCodeID codeAndLanguageCodeID = new CodeAndLanguageCodeID(); MapperUtils.map(registrationCenterType, codeAndLanguageCodeID); auditUtil.auditRequest(