added a check
This commit is contained in:
parent
729c1d8f1a
commit
4a095277e9
|
@ -205,17 +205,21 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
LOG.info("PublicationReport: " + report);
|
||||
Record registered = report.getTheRecord();
|
||||
|
||||
if(registered==null)
|
||||
throw new Exception(report.prettyPrint());
|
||||
|
||||
// String link = "toTest";
|
||||
CommitReport cRep = new CommitReport();
|
||||
|
||||
if(registered!=null)
|
||||
cRep.setRecordId(registered.getId());
|
||||
|
||||
cRep.setReport(report.prettyPrint());
|
||||
|
||||
switch (report.getStatus()) {
|
||||
case PASSED:
|
||||
cRep.setState(STATE.OK);
|
||||
if(cRep.getRecordId()==null) {
|
||||
LOG.error("The record id is null!!!");
|
||||
throw new Exception("Invalid record id");
|
||||
}
|
||||
break;
|
||||
case WARNING:
|
||||
cRep.setState(STATE.WARN);
|
||||
|
@ -235,7 +239,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
} catch (Exception e) {
|
||||
LOG.error("Error on commiting data: ", e);
|
||||
throw new Exception(
|
||||
"Error occurred on saving data, try again or contact the support. Error: " + e.getMessage());
|
||||
"Error occurred on saving data. Error: " + e.getMessage());
|
||||
} finally {
|
||||
// if(manager!=null) {
|
||||
// try {
|
||||
|
|
|
@ -29,7 +29,7 @@ public class CommitReport implements Serializable {
|
|||
}
|
||||
|
||||
public STATE state = STATE.UNKNOWN;
|
||||
public long recordId;
|
||||
public Long recordId;
|
||||
public String msg;
|
||||
public String report;
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class CommitReport implements Serializable {
|
|||
*
|
||||
* @return the record id
|
||||
*/
|
||||
public long getRecordId() {
|
||||
public Long getRecordId() {
|
||||
return recordId;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue