From 7558f82a76bafc041902f8ffa3b985616bce829d Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 27 Aug 2020 16:37:52 +0530 Subject: [PATCH] Add error log for backend policy validation failure --- .../mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java index a9fc47691e..d58c4ce870 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java @@ -83,6 +83,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService { .validatePolicyDetails(policyWrapper); // validation failure results; if (!features.isEmpty()) { + log.error("Policy feature/s validation failed."); return Response.status(Response.Status.BAD_REQUEST).entity(features).build(); } PolicyManagerService policyManagementService = DeviceMgtAPIUtils.getPolicyManagementService(); @@ -223,6 +224,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService { .validatePolicyDetails(policyWrapper); // validation failure results; if (!features.isEmpty()) { + log.error("Policy feature/s validation failed."); return Response.status(Response.Status.BAD_REQUEST).entity(features).build(); } PolicyManagerService policyManagementService = DeviceMgtAPIUtils.getPolicyManagementService(); @@ -480,6 +482,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService { = RequestValidationUtil.validateProfileFeatures(profileFeaturesList); // validation failure results; if (!features.isEmpty()) { + log.error("Policy feature/s validation failed."); return Response.status(Response.Status.BAD_REQUEST).entity(features).build(); } return Response.status(Response.Status.OK).entity("Valid request").build();