Commit 2d6da01e by Deborah Shapiro

Fix for error handling when SNOWOWL fails to do a concept lookup.

parent c7a9cbd1
......@@ -310,7 +310,11 @@ public class SnowowlTerminologyHandler extends AbstractTerminologyHandler {
+ URLEncoder.encode(expr, "UTF-8").replaceAll(" ", "%20") + "&limit="
+ Math.min(initialMaxLimit, localPfs.getMaxResults()) + "&offset="
+ localPfs.getStartIndex() + "&expand=pt()");
Logger.getLogger(getClass()).info( url + "/" + version + "/concepts?escg="
+ URLEncoder.encode(expr, "UTF-8").replaceAll(" ", "%20") + "&limit="
+ Math.min(initialMaxLimit, localPfs.getMaxResults()) + "&offset="
+ localPfs.getStartIndex() + "&expand=pt()");
Response response =
target.request(accept).header("Authorization", authHeader)
.header("Accept-Language", getAcceptLanguage(terminology, version))
......@@ -729,6 +733,10 @@ public class SnowowlTerminologyHandler extends AbstractTerminologyHandler {
}
ConceptList conceptList =
resolveExpression(terminologyId, terminology, version, null);
if (conceptList == null || conceptList.getObjects() == null ||
conceptList.getObjects().size() == 0){
return null;
}
return conceptList.getObjects().get(0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment