From 6d324c084ae58325f2aac0c804416fbad3f3aefc Mon Sep 17 00:00:00 2001 From: pasindu Date: Tue, 3 Sep 2024 09:45:07 +0530 Subject: [PATCH] Throw msg and the exception in relevent places --- .../status/task/OperationConfigurationService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/change/status/task/OperationConfigurationService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/change/status/task/OperationConfigurationService.java index 96c59ad4fc..fe7baac9fb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/change/status/task/OperationConfigurationService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/change/status/task/OperationConfigurationService.java @@ -49,7 +49,7 @@ public class OperationConfigurationService { } catch (MetadataManagementException e) { String msg = "Error occurred while retrieving operation configuration"; log.error(msg, e); - throw new OperationConfigException(e); + throw new OperationConfigException(msg, e); } if (metadata != null) { return gson.fromJson(metadata.getMetaValue(), OperationConfig.class); @@ -71,11 +71,11 @@ public class OperationConfigurationService { } catch (MetadataManagementException e) { String msg = "Error occurred while adding operation configuration"; log.error(msg, e); - throw new OperationConfigException(e); + throw new OperationConfigException(msg, e); } catch (MetadataKeyAlreadyExistsException e) { String msg = "Operation configuration already exists"; log.error(msg, e); - throw new OperationConfigAlreadyExistsException(e); + throw new OperationConfigAlreadyExistsException(msg, e); } } @@ -91,7 +91,7 @@ public class OperationConfigurationService { } catch (MetadataManagementException e) { String msg = "Error occurred while updating operation configuration"; log.error(msg, e); - throw new OperationConfigException(e); + throw new OperationConfigException(msg, e); } } @@ -102,11 +102,11 @@ public class OperationConfigurationService { } catch (MetadataManagementException e) { String msg = "Error occurred while deleting operation configuration"; log.error(msg, e); - throw new OperationConfigException(e); + throw new OperationConfigException(msg, e); } catch (MetadataKeyNotFoundException e) { String msg = "Operation configuration already exists"; log.error(msg, e); - throw new OperationConfigNotFoundException(e); + throw new OperationConfigNotFoundException(msg, e); } }