From 50b05342e81ecb9fa81551d340e7136dc61ec552 Mon Sep 17 00:00:00 2001 From: Florian Kleedorfer Date: Sat, 1 Jun 2024 22:50:28 +0200 Subject: [PATCH] GH-5000: Tone down WARN log output for frequent, non-critical events --- .../operation/TupleQueryResultConverter.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java b/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java index a27a8981994..80117b72db9 100644 --- a/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java +++ b/spring-components/rdf4j-spring/src/main/java/org/eclipse/rdf4j/spring/dao/support/operation/TupleQueryResultConverter.java @@ -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; @@ -56,8 +57,10 @@ public void consumeResult(Consumer 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; @@ -71,8 +74,10 @@ public T applyToResult(Function 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;