Merge branch 'corrective-policy' into 'corrective-policy'

Add missing error logs to OperationManagerImpl

See merge request entgra/carbon-device-mgt!704
This commit is contained in:
Dharmakeerthi Lasantha 2020-11-30 15:51:53 +00:00
commit b1abbf1508
2 changed files with 10 additions and 3 deletions

View File

@ -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);
}

View File

@ -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();
}