mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix error logs of DAO implementations
This commit is contained in:
parent
52de9b85e9
commit
59188bcdb3
@ -81,7 +81,6 @@ public class ReportManagementServiceImpl implements ReportManagementService {
|
||||
String msg = "No devices have enrolled between " + fromDate + " to " + toDate +
|
||||
" or doesn't match with" +
|
||||
" given parameters";
|
||||
log.error(msg);
|
||||
return Response.status(Response.Status.OK).entity(msg).build();
|
||||
} else {
|
||||
devices.setList((List<Device>) result.getData());
|
||||
|
||||
@ -422,8 +422,10 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
devices.add(device);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new DeviceManagementDAOException("Error occurred while fetching the list of devices that matches to status " +
|
||||
"'" + request.getStatus() + "'", e);
|
||||
String msg = "Error occurred while fetching the list of devices that matches to status " +
|
||||
"'" + request.getStatus() + "'";
|
||||
log.error(msg, e);
|
||||
throw new DeviceManagementDAOException(msg, e);
|
||||
} finally {
|
||||
DeviceManagementDAOUtil.cleanupResources(stmt, null);
|
||||
}
|
||||
@ -551,8 +553,10 @@ public class GenericDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
devices.add(device);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new DeviceManagementDAOException("Error occurred while fetching the list of devices corresponding" +
|
||||
"to the mentioned filtering criteria", e);
|
||||
String msg = "Error occurred while fetching the list of devices corresponding" +
|
||||
"to the mentioned filtering criteria";
|
||||
log.error(msg, e);
|
||||
throw new DeviceManagementDAOException(msg, e);
|
||||
} finally {
|
||||
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
||||
}
|
||||
|
||||
@ -428,8 +428,10 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
devices.add(device);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new DeviceManagementDAOException("Error occurred while fetching the list of devices that matches to status " +
|
||||
"'" + request.getStatus() + "'", e);
|
||||
String msg = "Error occurred while fetching the list of devices that matches to status " +
|
||||
"'" + request.getStatus() + "'";
|
||||
log.error(msg, e);
|
||||
throw new DeviceManagementDAOException(msg, e);
|
||||
} finally {
|
||||
DeviceManagementDAOUtil.cleanupResources(stmt, null);
|
||||
}
|
||||
@ -556,11 +558,10 @@ public class OracleDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
devices.add(device);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
String msg = "Error occurred while retrieving information of all " +
|
||||
"registered devices";
|
||||
String msg = "Error occurred while fetching the list of devices corresponding" +
|
||||
"to the mentioned filtering criteria";
|
||||
log.error(msg, e);
|
||||
throw new DeviceManagementDAOException("Error occurred while fetching the list of devices corresponding" +
|
||||
"to the mentioned filtering criteria", e);
|
||||
throw new DeviceManagementDAOException(msg, e);
|
||||
} finally {
|
||||
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
||||
}
|
||||
|
||||
@ -405,8 +405,10 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
devices.add(device);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new DeviceManagementDAOException("Error occurred while fetching the list of devices that matches to status " +
|
||||
"'" + request.getStatus() + "'", e);
|
||||
String msg = "Error occurred while fetching the list of devices that matches to status " +
|
||||
"'" + request.getStatus() + "'";
|
||||
log.error(msg, e);
|
||||
throw new DeviceManagementDAOException(msg, e);
|
||||
} finally {
|
||||
DeviceManagementDAOUtil.cleanupResources(stmt, null);
|
||||
}
|
||||
@ -534,8 +536,10 @@ public class PostgreSQLDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
devices.add(device);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new DeviceManagementDAOException("Error occurred while fetching the list of devices corresponding" +
|
||||
"to the mentioned filtering criteria", e);
|
||||
String msg = "Error occurred while fetching the list of devices corresponding" +
|
||||
"to the mentioned filtering criteria";
|
||||
log.error(msg, e);
|
||||
throw new DeviceManagementDAOException(msg, e);
|
||||
} finally {
|
||||
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
||||
}
|
||||
|
||||
@ -424,8 +424,10 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
devices.add(device);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new DeviceManagementDAOException("Error occurred while fetching the list of devices that matches to status " +
|
||||
"'" + request.getStatus() + "'", e);
|
||||
String msg = "Error occurred while fetching the list of devices that matches to status " +
|
||||
"'" + request.getStatus() + "'";
|
||||
log.error(msg, e);
|
||||
throw new DeviceManagementDAOException(msg, e);
|
||||
} finally {
|
||||
DeviceManagementDAOUtil.cleanupResources(stmt, null);
|
||||
}
|
||||
@ -489,8 +491,10 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
|
||||
devices.add(device);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
throw new DeviceManagementDAOException("Error occurred while fetching the list of devices corresponding" +
|
||||
"to the mentioned filtering criteria", e);
|
||||
String msg = "Error occurred while fetching the list of devices corresponding" +
|
||||
"to the mentioned filtering criteria";
|
||||
log.error(msg, e);
|
||||
throw new DeviceManagementDAOException(msg, e);
|
||||
} finally {
|
||||
DeviceManagementDAOUtil.cleanupResources(stmt, rs);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user