Skip to content

Commit f81fc92

Browse files
GH-2285 - Unwrap invocation target exceptions in the AutoCloseableQueryRunner.
Closes #2285.
1 parent 7bd1833 commit f81fc92

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/org/springframework/data/neo4j/core/DefaultNeo4jClient.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package org.springframework.data.neo4j.core;
1717

1818
import java.lang.reflect.InvocationHandler;
19+
import java.lang.reflect.InvocationTargetException;
1920
import java.lang.reflect.Method;
2021
import java.lang.reflect.Proxy;
2122
import java.util.Collection;
@@ -105,7 +106,11 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
105106
}
106107
return null;
107108
} else {
108-
return method.invoke(target, args);
109+
try {
110+
return method.invoke(target, args);
111+
} catch (InvocationTargetException ite) {
112+
throw ite.getCause();
113+
}
109114
}
110115
}
111116
}

0 commit comments

Comments
 (0)