mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Refactor license management
This commit is contained in:
parent
7cbf71ddd7
commit
dcac237380
@ -133,7 +133,8 @@ public class Device {
|
||||
@GET
|
||||
@Path("/license")
|
||||
@Produces("text/plain")
|
||||
public String getLicense() {
|
||||
public String getLicense() throws AndroidAgentException{
|
||||
|
||||
License license = null;
|
||||
try {
|
||||
try {
|
||||
@ -141,10 +142,12 @@ public class Device {
|
||||
.MobileDeviceTypes
|
||||
.MOBILE_DEVICE_TYPE_ANDROID, DeviceManagementConstants.LanguageCodes.LANGUAGE_CODE_ENGLISH_US);
|
||||
} catch (LicenseManagementException e) {
|
||||
e.printStackTrace();
|
||||
String errorMsg = "License management service error";
|
||||
throw new AndroidAgentException(errorMsg, e);
|
||||
}
|
||||
}catch(DeviceManagementServiceException deviceMgtEx){
|
||||
deviceMgtEx.printStackTrace();
|
||||
String errorMsg = "Device management service error";
|
||||
throw new AndroidAgentException(errorMsg, deviceMgtEx);
|
||||
}
|
||||
return license.getLicenseText();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user