From 908161d23eada648376fd5ea70aa957c9188fc5c Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Tue, 28 Apr 2020 16:11:57 +0530 Subject: [PATCH] Add warning log when an invalid group name is provided --- .../wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java index 644cd1088d..389f0a06ce 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java @@ -1001,6 +1001,9 @@ import java.util.stream.IntStream; List deviceIdentifiers = new ArrayList<>(); deviceIdentifiers.add(deviceIdentifier); groupManagementProviderService.addDevices(deviceGroup.getGroupId(), deviceIdentifiers); + } else { + log.warn("Group name: " + groupName + " configured for device " + + deviceIdentifier.toString() + " is invalid because the group does not exist."); } } catch (GroupManagementException e) { String msg = "Error occurred while trying to add the device '" + deviceIdentifier.getId() +