Skip to content

Commit

Permalink
Merge pull request #3 from solhm/dans-master
Browse files Browse the repository at this point in the history
Error messages with the registration service for publishing dataset.
  • Loading branch information
4tikhonov authored Mar 21, 2017
2 parents 5be3fa8 + 241f91c commit faea650
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/main/java/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,9 @@ dataset.share.datasetShare=Share Dataset
dataset.share.datasetShare.tip=Share this dataset on your favorite social media networks.
dataset.share.datasetShare.shareText=View this dataset.
dataset.publish.error.datacite=This dataset may not be published because the <a href=\"http://status.datacite.org/\" title=\"DataCite Status Page\" target=\"_blank\"/>DataCite Service</a> is currently inaccessible. Please try again. Does the issue continue to persist?
dataset.publish.error.DataCiteException=This dataset may not be published because the <a href=\"http://status.datacite.org/\" title=\"DataCite Status Page\" target=\"_blank\"/>DataCite Service</a> is currently inaccessible. Please try again. Does the issue continue to persist?
dataset.publish.error.HandleException=This dataset may not be published because the <a href=\"https://hdl.handle.net/\" title=\"handle proxy \" target=\"_blank\"/>Handle.net Service</a> is currently inaccessible. Please try again. Does the issue continue to persist?
dataset.publish.error.EZIDException=This dataset may not be published because the <a href=\"http://ezid.lib.purdue.edu/contact/\" title=\"ezid contact Page\" target=\"_blank\"/>EZID Service</a> is currently inaccessible. Please try again. Does the issue continue to persist?
dataset.publish.error.doi=This dataset may not be published because the DOI update failed.
dataset.delete.error.datacite=Could not deaccession the dataset because the DOI update failed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public Dataset execute(CommandContext ctxt) throws CommandException {
}
}
} catch (Throwable e) {
// TODO add a variant for EZId
throw new CommandException(ResourceBundle.getBundle("Bundle").getString("dataset.publish.error.datacite"), this);
String exceptionName=e.getClass().getSimpleName();
throw new CommandException(ResourceBundle.getBundle("Bundle").getString("dataset.publish.error."+exceptionName), this);
}
} else {
throw new IllegalCommandException("This dataset may not be published because its id registry service is not supported.", this);
Expand Down Expand Up @@ -220,9 +220,12 @@ public Dataset execute(CommandContext ctxt) throws CommandException {
}

if (idServiceBean!= null && !idServiceBean.registerWhenPublished())
if (!idServiceBean.publicizeIdentifier(savedDataset))
throw new CommandException(ResourceBundle.getBundle("Bundle").getString("dataset.publish.error.datacite"), this);

try{
idServiceBean.publicizeIdentifier(savedDataset);
}catch (Throwable e) {
String exceptionName=e.getClass().getSimpleName();
throw new CommandException(ResourceBundle.getBundle("Bundle").getString("dataset.publish.error."+exceptionName), this);
}
PrivateUrl privateUrl = ctxt.engine().submit(new GetPrivateUrlCommand(getRequest(), savedDataset));
if (privateUrl != null) {
logger.fine("Deleting Private URL for dataset id " + savedDataset.getId());
Expand Down

0 comments on commit faea650

Please sign in to comment.