[Bleeding] Skip InvocationTargetException. Addresses BUKKIT-774

This commit is contained in:
Wesley Wolfe
2012-02-16 18:14:39 -06:00
committed by EvilSeph
parent 45833c282d
commit f8804423bf
2 changed files with 14 additions and 2 deletions

View File

@@ -5,6 +5,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
@@ -143,6 +144,8 @@ public class JavaPluginLoader implements PluginLoader {
result = constructor.newInstance();
result.initialize(this, server, description, dataFolder, file, loader);
} catch (InvocationTargetException ex) {
throw new InvalidPluginException(ex.getCause());
} catch (Throwable ex) {
throw new InvalidPluginException(ex);
}
@@ -298,6 +301,8 @@ public class JavaPluginLoader implements PluginLoader {
return;
}
method.invoke(listener, event);
} catch (InvocationTargetException ex) {
throw new EventException(ex.getCause());
} catch (Throwable t) {
throw new EventException(t);
}