From 10e647efb35050ffdbdd5094bdde724f0dc3a4bc Mon Sep 17 00:00:00 2001 From: nipuni Date: Wed, 2 Oct 2024 11:05:36 +0530 Subject: [PATCH] Add improvements for Allowed Device Status View --- .../jaxrs/service/impl/DeviceStatusFilterServiceImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceStatusFilterServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceStatusFilterServiceImpl.java index 680a4e5516..b2f958754b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceStatusFilterServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceStatusFilterServiceImpl.java @@ -74,8 +74,12 @@ public class DeviceStatusFilterServiceImpl implements DeviceStatusFilterService DeviceStatusManagementService deviceManagementProviderService = DeviceMgtAPIUtils.getDeviceStatusManagmentService(); result = deviceManagementProviderService.getDeviceStatusCheck(tenantId); return Response.status(Response.Status.OK).entity(result).build(); + } catch (MetadataKeyNotFoundException e) { + String msg = "Couldn't find the device status check metadata for tenant ID: " + tenantId; + log.error(msg, e); + return Response.status(Response.Status.NOT_FOUND).entity(msg).build(); } catch (MetadataManagementException e) { - String msg = "Error occurred while getting device status filter of the tenant."; + String msg = "Error occurred while getting device status check for the tenant."; log.error(msg, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } -- 2.36.3