Skip to content

Commit 31d4835

Browse files
GH-2285 - Unwrap invocation target exceptions in the AutoCloseableQueryRunner.
Closes #2285.
1 parent 2a86da1 commit 31d4835

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

+6-1
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;
@@ -107,7 +108,11 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
107108
}
108109
return null;
109110
} else {
110-
return method.invoke(target, args);
111+
try {
112+
return method.invoke(target, args);
113+
} catch (InvocationTargetException ite) {
114+
throw ite.getCause();
115+
}
111116
}
112117
}
113118
}

0 commit comments

Comments
 (0)