Skip to content

Commit 50b0534

Browse files
committed
GH-5000: Tone down WARN log output for frequent, non-critical events
1 parent ac2accd commit 50b0534

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.stream.Collectors;
2929
import java.util.stream.Stream;
3030

31+
import org.eclipse.rdf4j.common.exception.RDF4JException;
3132
import org.eclipse.rdf4j.query.BindingSet;
3233
import org.eclipse.rdf4j.query.TupleQueryResult;
3334
import org.eclipse.rdf4j.spring.dao.support.BindingSetMapper;
@@ -56,8 +57,10 @@ public void consumeResult(Consumer<TupleQueryResult> consumer) {
5657
try {
5758
consumer.accept(tupleQueryResult);
5859
} catch (Exception e) {
59-
logger.debug("Caught execption while processing TupleQueryResult", e);
60-
throw mapException("Error processing TupleQueryResult", e);
60+
logger.debug("Caught execption while processing TupleQueryResult: {}", e.getMessage());
61+
RDF4JException mapped = mapException("Error processing TupleQueryResult", e);
62+
logger.debug("Re-throwing as {} ", mapped.getClass().getSimpleName());
63+
throw mapped;
6164
} finally {
6265
tupleQueryResult.close();
6366
tupleQueryResult = null;
@@ -71,8 +74,10 @@ public <T> T applyToResult(Function<TupleQueryResult, T> function) {
7174
try {
7275
return function.apply(tupleQueryResult);
7376
} catch (Exception e) {
74-
logger.warn("Caught execption while processing TupleQueryResult", e);
75-
throw mapException("Error processing TupleQueryResult", e);
77+
logger.debug("Caught execption while processing TupleQueryResult: {}", e.getMessage());
78+
RDF4JException mapped = mapException("Error processing TupleQueryResult", e);
79+
logger.debug("Re-throwing as {} ", mapped.getClass().getSimpleName());
80+
throw mapped;
7681
} finally {
7782
tupleQueryResult.close();
7883
tupleQueryResult = null;

0 commit comments

Comments
 (0)