summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-02-24 00:51:09 +0000
committerRich Hickey <richhickey@gmail.com>2009-02-24 00:51:09 +0000
commit8b16bff0cb7cd3f84f1eb8609b6dce4b2a77f0c4 (patch)
tree54003e350e53aa012eb675dfbd5ad166a2e16d99 /src
parent7de85da26926cf9350f1ee4638a32fac26208216 (diff)
unwrap InvocationTargetException's around Errors in reflective calls [issue 44]
Diffstat (limited to 'src')
-rw-r--r--src/jvm/clojure/lang/Reflector.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/jvm/clojure/lang/Reflector.java b/src/jvm/clojure/lang/Reflector.java
index f530b786..b62ef7f0 100644
--- a/src/jvm/clojure/lang/Reflector.java
+++ b/src/jvm/clojure/lang/Reflector.java
@@ -31,6 +31,8 @@ public static Object invokeInstanceMethod(Object target, String methodName, Obje
{
if(e.getCause() instanceof Exception)
throw (Exception) e.getCause();
+ else if(e.getCause() instanceof Error)
+ throw (Error) e.getCause();
throw e;
}
}
@@ -89,6 +91,8 @@ static Object invokeMatchingMethod(String methodName, List methods, Object targe
{
if(e.getCause() instanceof Exception)
throw (Exception) e.getCause();
+ else if(e.getCause() instanceof Error)
+ throw (Error) e.getCause();
throw e;
}
@@ -162,6 +166,8 @@ public static Object invokeConstructor(Class c, Object[] args) throws Exception{
{
if(e.getCause() instanceof Exception)
throw (Exception) e.getCause();
+ else if(e.getCause() instanceof Error)
+ throw (Error) e.getCause();
throw e;
}
}
@@ -181,6 +187,8 @@ public static Object invokeStaticMethod(String className, String methodName, Obj
{
if(e.getCause() instanceof Exception)
throw (Exception) e.getCause();
+ else if(e.getCause() instanceof Error)
+ throw (Error) e.getCause();
throw e;
}
}