managed Validation and Publishing Exceptions

This commit is contained in:
francesco 2020-10-28 14:49:57 +01:00
parent 38da57c9b0
commit 1fc382b0c2
2 changed files with 18 additions and 2 deletions

View File

@ -27,7 +27,6 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">

View File

@ -14,6 +14,8 @@ import org.gcube.application.geoportal.model.concessioni.LayerConcessione;
import org.gcube.application.geoportal.model.concessioni.RelazioneScavo;
import org.gcube.application.geoportal.model.content.UploadedImage;
import org.gcube.application.geoportal.model.content.WorkspaceContent;
import org.gcube.application.geoportal.model.fault.PublishException;
import org.gcube.application.geoportal.model.fault.ValidationException;
import org.gcube.portlets.user.geoportaldataentry.client.ConcessioniFormCardTitle;
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryService;
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
@ -191,9 +193,24 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
}
return cRep;
}catch (ValidationException e1){
LOG.error("Error on validating data: ",e1);
throw new Exception("Error on validating data: "+e1.getReport().toString());
}catch (PublishException e2) {
LOG.error("Error on publishing data: ",e2);
throw new Exception("Error on publishing data: "+e2.getMessage());
}catch (Exception e) {
LOG.error("Error on commiting data: ",e);
throw new Exception("Error occurred on saving data, try again or contact the support");
throw new Exception("Error occurred on saving data, try again or contact the support. Error: "+e.getMessage());
}finally {
/*if(manager!=null) {
try {
manager.shutdown();
}catch (Exception e) {
//silent
}
}*/
}