Add metaData validtion and set throw the MetadataManagementException

pull/154/head
Nishan Sangeeth 1 year ago
parent cfb1173d06
commit 229c8dcb34

@ -27,6 +27,7 @@ import io.entgra.device.mgt.core.application.mgt.common.response.Category;
import io.entgra.device.mgt.core.application.mgt.common.response.Tag;
import io.entgra.device.mgt.core.device.mgt.common.Base64File;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationArtifact;
import io.entgra.device.mgt.core.application.mgt.common.LifecycleChanger;
@ -402,7 +403,7 @@ public interface ApplicationManager {
* To validate the application creating request
*
*/
<T> void validateAppCreatingRequest(T param) throws ApplicationManagementException, RequestValidatingException;
<T> void validateAppCreatingRequest(T param) throws ApplicationManagementException, RequestValidatingException, MetadataManagementException;
/**
*

@ -3515,7 +3515,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
}
@Override
public <T> void validateAppCreatingRequest(T param) throws ApplicationManagementException, RequestValidatingException {
public <T> void validateAppCreatingRequest(T param)
throws ApplicationManagementException, RequestValidatingException, MetadataManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
String userName = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
int deviceTypeId = -1;
@ -3748,8 +3749,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (MetadataManagementException e) {
log.error("Error occurred while retrieving metadata list", e);
throw new RuntimeException(e);
String msg = "Error occurred while retrieving metadata list";
log.error(msg, e);
throw new MetadataManagementException(msg, e);
} finally {
ConnectionManagerUtil.closeDBConnection();
}

Loading…
Cancel
Save