Skip to content
Snippets Groups Projects

fix: check deposit is not completely null after importing from a DOI after verifying all services

Merged Alicia.DeDiosFuente requested to merge adf-import-doi into master
All threads resolved!
Files
2
@@ -126,6 +126,10 @@ public class MetadataImportWorkFlowService {
} catch (SolidifyRuntimeException e) {
try {
depositDoc = this.doiCrossrefImportService.searchDoi(cleanedDoi, depositDoc);
// Check that first step properties have been recovered.
if (this.isDepositDataNull(depositDoc)) {
throw new SolidifyRuntimeException("The doi has not been found neither in crossref.");
}
} catch (SolidifyRuntimeException exception) {
try {
depositDoc = this.dataCiteImportService.searchDoi(cleanedDoi, depositDoc);
@@ -150,7 +154,8 @@ public class MetadataImportWorkFlowService {
// Check that first step properties have been recovered.
if (this.isDepositDataNull(depositDoc)) {
throw new SolidifyRuntimeException("The doi has not been found neither in crossref, datacite or arxiv.");
throw new SolidifyHttpErrorException(HttpStatus.NOT_FOUND,
this.messageService.get("deposit.error.identifiers.doi.not_found", new Object[] { cleanedDoi }));
}
this.checkForIndirectDuplicate(Publication.ImportSource.DOI, depositDoc);
Loading