Skip to content

Commit

Permalink
ensure exception is correctly unwrapped from proxy
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.codehaus.org/groovy/trunk/groovy/groovy-core@21326 a5544e8c-8a19-0410-ba12-f9af4593a198
  • Loading branch information
blackdrag committed Dec 15, 2010
1 parent c4c2046 commit bdd732a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/org/codehaus/groovy/runtime/ConversionHandler.java
Expand Up @@ -16,6 +16,8 @@

package org.codehaus.groovy.runtime;

import groovy.lang.GroovyRuntimeException;

import java.io.Serializable;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
Expand Down Expand Up @@ -76,7 +78,11 @@ public Object getDelegate() {
*/
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (!checkMethod(method)) {
return invokeCustom(proxy, method, args);
try {
return invokeCustom(proxy, method, args);
} catch (GroovyRuntimeException gre) {
throw ScriptBytecodeAdapter.unwrap(gre);
}
}
try {
return method.invoke(this, args);
Expand Down

0 comments on commit bdd732a

Please sign in to comment.