From 0f38c1a9df81b9a8b40685a90fea7fb24f00d1c7 Mon Sep 17 00:00:00 2001 From: nishan Date: Wed, 28 Jun 2023 21:22:39 +0530 Subject: [PATCH] Catch MetadataManagementException and throw ApplicationManagementException --- .../application/mgt/common/services/ApplicationManager.java | 2 +- .../application/mgt/core/impl/ApplicationManagerImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java index b302616812..0c75b3b284 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java @@ -403,7 +403,7 @@ public interface ApplicationManager { * To validate the application creating request * */ - void validateAppCreatingRequest(T param) throws ApplicationManagementException, RequestValidatingException, MetadataManagementException; + void validateAppCreatingRequest(T param) throws ApplicationManagementException, RequestValidatingException; /** * diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java index 33c29072ed..3bb8ba8260 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java @@ -3516,7 +3516,7 @@ public class ApplicationManagerImpl implements ApplicationManager { @Override public void validateAppCreatingRequest(T param) - throws ApplicationManagementException, RequestValidatingException, MetadataManagementException { + throws ApplicationManagementException, RequestValidatingException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); int deviceTypeId = -1; @@ -3751,7 +3751,7 @@ public class ApplicationManagerImpl implements ApplicationManager { } catch (MetadataManagementException e) { String msg = "Error occurred while retrieving metadata list"; log.error(msg, e); - throw new MetadataManagementException(msg, e); + throw new ApplicationManagementException(msg, e); } finally { ConnectionManagerUtil.closeDBConnection(); }