Skip to content
Snippets Groups Projects
Commit a121588d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when data in database is wrong exception is properly handled

parent d2b9ced8
No related branches found
No related tags found
1 merge request!92Chemical serialization issue
......@@ -12,6 +12,7 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang3.SerializationException;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.w3c.dom.Node;
......@@ -353,8 +354,12 @@ public class ChemicalParser extends CachableInterface implements IExternalServic
// look for chemical in the cache
Node chemicalNode = super.getCacheNode(getIdentifier(diseaseID, chemicalId));
if (chemicalNode != null && chemicalNode.hasChildNodes()) {
result = chemicalSerializer.xmlToObject(chemicalNode);
return result;
try {
result = chemicalSerializer.xmlToObject(chemicalNode);
return result;
} catch (SerializationException e) {
logger.error(e, e);
}
}
try {
String diseaseQuery = DISEASE_URL + diseaseID.getResource();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment