GH-2285 - Unwrap invocation target exceptions in the AutoCloseableQueryRunner.

Closes #2285.
This commit is contained in:
Michael Simons
2021-06-10 14:59:37 +02:00
parent 91a54da664
commit dcd422d637

View File

@@ -16,6 +16,7 @@
package org.springframework.data.neo4j.core;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Collection;
@@ -107,7 +108,11 @@ class DefaultNeo4jClient implements Neo4jClient {
}
return null;
} else {
return method.invoke(target, args);
try {
return method.invoke(target, args);
} catch (InvocationTargetException ite) {
throw ite.getCause();
}
}
}
}