From 195c48c85ebc9c6976a8efaf9fc908f310ebba06 Mon Sep 17 00:00:00 2001 From: pramilaniroshan Date: Mon, 1 Jul 2024 09:21:24 +0530 Subject: [PATCH] Resolve comments --- .../metadata/mgt/DeviceStatusManagementServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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/metadata/mgt/DeviceStatusManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/DeviceStatusManagementServiceImpl.java index 3d4d557a79..956e65d851 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/DeviceStatusManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/DeviceStatusManagementServiceImpl.java @@ -150,7 +150,9 @@ public class DeviceStatusManagementServiceImpl implements DeviceStatusManagement public void updateDefaultDeviceStatusFilters(int tenantId, String deviceType, List deviceStatus) throws MetadataManagementException { try { if (StringUtils.isEmpty(deviceType)) { - throw new IllegalArgumentException("Device type must not be empty or null"); + String msg = "Device type must not be empty or null"; + log.error(msg); + throw new IllegalArgumentException(msg); } MetadataManagementDAOFactory.beginTransaction(); // Retrieve the current device status metadata @@ -267,7 +269,9 @@ public class DeviceStatusManagementServiceImpl implements DeviceStatusManagement @Override public boolean isDeviceStatusValid(String deviceType, String deviceStatus, int tenantId) throws MetadataManagementException { if (StringUtils.isEmpty(deviceType)) { - throw new IllegalArgumentException("Device type must not be empty or null"); + String msg = "Device type must not be empty or null"; + log.error(msg); + throw new IllegalArgumentException(msg); } MetadataManagementService metadataManagementService = new MetadataManagementServiceImpl(); Metadata metadata = metadataManagementService.retrieveMetadata(MetadataConstants.ALLOWED_DEVICE_STATUS_META_KEY);