From caba7fc673aab81055363cd8ff97ef4366c85451 Mon Sep 17 00:00:00 2001 From: Pahansith Gunathilake Date: Mon, 30 Nov 2020 15:51:52 +0000 Subject: [PATCH] Add missing error logs to OperationManagerImpl --- .../jaxrs/service/impl/GeoLocationBasedServiceImpl.java | 5 ++++- .../mgt/core/operation/mgt/OperationManagerImpl.java | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java index ce7fecc806..b2c28d8f1e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java @@ -733,7 +733,10 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { constructCollectionType(List.class, EventAction.class)); eventData.setActions(eventActions); } catch (IOException e) { - log.error("Error occurred while parsing event actions of the event with ID " + event.getEventId()); + if (log.isDebugEnabled()) { + log.warn("Error occurred while parsing event actions of the event with ID " + event.getEventId()); + } + continue; } eventList.add(eventData); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 07529f588e..8514b8f3b8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -250,9 +250,13 @@ public class OperationManagerImpl implements OperationManager { return activity; } catch (OperationManagementDAOException e) { OperationManagementDAOFactory.rollbackTransaction(); - throw new OperationManagementException("Error occurred while adding operation", e); + String msg = "Error occurred while adding operation"; + log.error(msg, e); + throw new OperationManagementException(msg, e); } catch (TransactionManagementException e) { - throw new OperationManagementException("Error occurred while initiating the transaction", e); + String msg = "Error occurred while initiating the transaction"; + log.error(msg, e); + throw new OperationManagementException(msg, e); } finally { OperationManagementDAOFactory.closeConnection(); }