diff options
author | Rich Hickey <richhickey@gmail.com> | 2009-02-24 00:51:09 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2009-02-24 00:51:09 +0000 |
commit | 8b16bff0cb7cd3f84f1eb8609b6dce4b2a77f0c4 (patch) | |
tree | 54003e350e53aa012eb675dfbd5ad166a2e16d99 | |
parent | 7de85da26926cf9350f1ee4638a32fac26208216 (diff) |
unwrap InvocationTargetException's around Errors in reflective calls [issue 44]
-rw-r--r-- | src/jvm/clojure/lang/Reflector.java | 8 |
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; } } |