fixing UndeclaredThrowableException on compilation cancel (IDEA-154699)

This commit is contained in:
Eugene Zhuravlev
2016-04-14 10:21:37 +02:00
parent bca3719ab2
commit e39de895a4
@@ -197,7 +197,13 @@ public class JavacMain {
return (StandardJavaFileManager)Proxy.newProxyInstance(fileManager.getClass().getClassLoader(), new Class[]{StandardJavaFileManager.class}, new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return method.invoke(fileManager.getApiCallHandler(method), args);
try {
return method.invoke(fileManager.getApiCallHandler(method), args);
}
catch (InvocationTargetException e) {
final Throwable cause = e.getCause();
throw cause != null? cause : e;
}
}
});
}