Catch YAML exceptions as InvalidPluginExceptions

By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
Bukkit/Spigot
2011-04-01 09:59:24 +02:00
parent 857d950045
commit 412fb96061

View File

@@ -24,6 +24,7 @@ import org.bukkit.event.server.*;
import org.bukkit.event.vehicle.*; import org.bukkit.event.vehicle.*;
import org.bukkit.event.world.*; import org.bukkit.event.world.*;
import org.bukkit.plugin.*; import org.bukkit.plugin.*;
import org.yaml.snakeyaml.error.YAMLException;
/** /**
* Represents a Java plugin loader, allowing plugins in the form of .jar * Represents a Java plugin loader, allowing plugins in the form of .jar
@@ -62,6 +63,8 @@ public final class JavaPluginLoader implements PluginLoader {
jar.close(); jar.close();
} catch (IOException ex) { } catch (IOException ex) {
throw new InvalidPluginException(ex); throw new InvalidPluginException(ex);
} catch (YAMLException ex) {
throw new InvalidPluginException(ex);
} }
File dataFolder = getDataFolder(file); File dataFolder = getDataFolder(file);