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 a65be43693d..96053acfd07 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;