Capture errors in plugins onLoad

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
CraftBukkit/Spigot 2011-03-31 22:33:06 +01:00
parent 57fa7c0118
commit f3fe2a426c

View file

@ -64,8 +64,8 @@ public final class CraftServer implements Server {
for (Plugin plugin : plugins) {
try {
plugin.onLoad();
} catch (AbstractMethodError ame) {
Logger.getLogger("Minecraft").warning("Plugin: " + plugin.getDescription().getName() + " does not support the onLoad() method");
} catch (Throwable ex) {
Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
}
}
for (Plugin plugin : plugins) {