Skip to content

Commit

Permalink
#34 align with consortium code
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed Feb 18, 2022
1 parent 46a1c94 commit 6bba48c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ public String textSearch(final String queryText, final String endpointUrl, final

awaitTerminationAfterShutdown(executor);

if (results.get(0) == null) {
log.error("null result at index 0");
}

String resultText = results.get(0).get();
if (resultText == null || resultText.isEmpty()) {
log.error("null or empty query result");
throw new JargonRuntimeException("null or empty query result from search plugin");
}

return results.get(0).get();

} catch (InterruptedException | ExecutionException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public String call() throws Exception {
log.debug("response:{}", response);
HttpEntity entity = response.getEntity();
stringJsonResponse = MiscIRODSUtils.convertStreamToString(entity.getContent());
log.info("stringJsonResponse:{}", stringJsonResponse);

} catch (IOException e) {
log.error("error accessing endpoint:{}", textSearchRequest.getEndpointUrl(), e);
Expand Down

0 comments on commit 6bba48c

Please sign in to comment.