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

Add missing error logs to OperationManagerImpl

See merge request entgra/carbon-device-mgt!704
corrective-policy
Dharmakeerthi Lasantha 4 years ago
commit b1abbf1508

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

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

Loading…
Cancel
Save