Skip to content

Commit

Permalink
GH-5000: Tone down WARN log output for frequent, non-critical events
Browse files Browse the repository at this point in the history
  • Loading branch information
fkleedorfer committed Jun 3, 2024
1 parent ac2accd commit 50b0534
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.eclipse.rdf4j.common.exception.RDF4JException;
import org.eclipse.rdf4j.query.BindingSet;
import org.eclipse.rdf4j.query.TupleQueryResult;
import org.eclipse.rdf4j.spring.dao.support.BindingSetMapper;
Expand Down Expand Up @@ -56,8 +57,10 @@ public void consumeResult(Consumer<TupleQueryResult> consumer) {
try {
consumer.accept(tupleQueryResult);
} catch (Exception e) {
logger.debug("Caught execption while processing TupleQueryResult", e);
throw mapException("Error processing TupleQueryResult", e);
logger.debug("Caught execption while processing TupleQueryResult: {}", e.getMessage());
RDF4JException mapped = mapException("Error processing TupleQueryResult", e);
logger.debug("Re-throwing as {} ", mapped.getClass().getSimpleName());
throw mapped;
} finally {
tupleQueryResult.close();
tupleQueryResult = null;
Expand All @@ -71,8 +74,10 @@ public <T> T applyToResult(Function<TupleQueryResult, T> function) {
try {
return function.apply(tupleQueryResult);
} catch (Exception e) {
logger.warn("Caught execption while processing TupleQueryResult", e);
throw mapException("Error processing TupleQueryResult", e);
logger.debug("Caught execption while processing TupleQueryResult: {}", e.getMessage());
RDF4JException mapped = mapException("Error processing TupleQueryResult", e);
logger.debug("Re-throwing as {} ", mapped.getClass().getSimpleName());
throw mapped;
} finally {
tupleQueryResult.close();
tupleQueryResult = null;
Expand Down

0 comments on commit 50b0534

Please sign in to comment.