Skip to content

Commit

Permalink
If the eml package object is null, an exception will be thrown instea…
Browse files Browse the repository at this point in the history
…d of using the default factory.
  • Loading branch information
taojing2002 committed May 29, 2019
1 parent 087c076 commit fb8252f
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -69,7 +69,7 @@ public boolean canProcess(String namespace) {
if(namespace != null && namespace.startsWith("eml://ecoinformatics.org/eml-2")) {
can = true;
}
logMetacat.debug("EML2DataCitFactory.canProcess - If this factory can process the xml with the name space "+namespace+"? "+can);
logMetacat.debug("EML2DataCitFactory.canProcess - If this factory can process the xml with the name space " + namespace + "? " + can);
return can;
}

Expand Down Expand Up @@ -143,9 +143,7 @@ public String generateMetadata(Identifier identifier, SystemMetadata sysmeta) th
}
return serializeDoc(doc);
} else {
logMetacat.warn("EML2DataCiteFactory.generateMetadata - the eml package is null and we have to use the default factory");
DefaultDataCiteFactory factory = new DefaultDataCiteFactory();
return factory.generateMetadata(identifier, sysmeta);
throw new ServiceFailure("1030", "Metacat can't parse the eml object " + identifier.getValue() + " so we can't get the needed information from it.");
}
} catch (InvalidRequest e) {
throw e;
Expand Down

0 comments on commit fb8252f

Please sign in to comment.