Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/main/java/play/template2/GTJavaExtensionsInvoker.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public abstract class GTJavaExtensionsInvoker {
static interface WrappedMethod {
public Object invoke(Object o, Object[] args) throws Exception;
}

static class WrappedJavaMethod implements WrappedMethod {
private final Method m;

Expand All @@ -53,7 +53,13 @@ static class WrappedJavaMethod implements WrappedMethod {

@Override
public Object invoke(Object o, Object[] args) throws Exception {
return m.invoke(o, args);
try {
return m.invoke(o, args);
} catch (InvocationTargetException wrapped) {
Throwable e = wrapped.getTargetException();
if (e instanceof Error) throw (Error) e;
throw (Exception) e;
}
}
}

Expand Down