Skip to content

Commit

Permalink
allow dataset to be created if DataCite is down #5093
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed May 22, 2020
1 parent 431ee35 commit 9cbd5d3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ public String reserveIdentifier(String identifier, Map<String, String> metadata,
retString = client.postMetadata(xmlMetadata);
} catch (UnsupportedEncodingException ex) {
Logger.getLogger(DOIDataCiteRegisterService.class.getName()).log(Level.SEVERE, null, ex);
} catch (RuntimeException ex) {
/**
* We're catching this runtime exception because we want the
* dataset to be created even if DataCite is down and we can't
* reserve the DOI.
*/
String msg = "Unable to reserve DOI from DataCite: " + ex.getLocalizedMessage();
logger.severe(msg);
retString = msg;
}
}
return retString;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ protected void registerExternalIdentifier(Dataset theDataset, CommandContext ctx
}
// Invariant: Dataset identifier does not exist in the remote registry
globalIdServiceBean.createIdentifier(theDataset);
// FIXME: Only set the create time if createIdentifier succeeded.
theDataset.setGlobalIdCreateTime(getTimestamp());
theDataset.setIdentifierRegistered(true);

Expand Down

0 comments on commit 9cbd5d3

Please sign in to comment.