mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Throwing exception on getDevice when device is not found
This commit is contained in:
parent
e8d8373d46
commit
289987db8e
@ -823,11 +823,12 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
DeviceManagementDAOFactory.openConnection();
|
DeviceManagementDAOFactory.openConnection();
|
||||||
device = deviceDAO.getDevice(deviceId, this.getTenantId());
|
device = deviceDAO.getDevice(deviceId, this.getTenantId());
|
||||||
if (device == null) {
|
if (device == null) {
|
||||||
|
String msg = "No device is found upon the type '" + deviceId.getType() + "' and id '" +
|
||||||
|
deviceId.getId() + "'";
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("No device is found upon the type '" + deviceId.getType() + "' and id '" +
|
log.debug(msg);
|
||||||
deviceId.getId() + "'");
|
|
||||||
}
|
}
|
||||||
return null;
|
throw new DeviceManagementException(msg);
|
||||||
}
|
}
|
||||||
DeviceInfo info = deviceInfoDAO.getDeviceInformation(device.getId());
|
DeviceInfo info = deviceInfoDAO.getDeviceInformation(device.getId());
|
||||||
DeviceLocation location = deviceInfoDAO.getDeviceLocation(device.getId());
|
DeviceLocation location = deviceInfoDAO.getDeviceLocation(device.getId());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user