Handle and log exceptions during sparql based matching
@@ -330,6 +330,7 @@ public class SparqlMatcherActor extends UntypedActor {
}
Set<NeedModelWrapper> needs = query.map(q -> {
+ try {
Query compiledQuery = OpAsQuery.asQuery(q);
// if we were given a needUriToMatch, restrict the query result to that uri so that
@@ -366,6 +367,11 @@ public class SparqlMatcherActor extends UntypedActor {
.collect(Collectors.toSet());
return matchedNeeds;
+ } catch (Exception e) {
+ log.info("caught exception during sparql-based matching (more info on loglevel 'debug'): {} ", e.getMessage());
+ log.debug("full exception:", e);
+ return Collections.EMPTY_SET;
+ }
})
.orElse(new HashSet<>());
