[Bleeding] Exception cleanup. Addresses BUKKIT-774

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot
2012-02-18 17:15:59 -06:00
parent 91c8bbacc7
commit b58168b112
8 changed files with 67 additions and 131 deletions

View File

@@ -181,13 +181,7 @@ public class YamlConfiguration extends FileConfiguration {
} catch (IOException ex) {
Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file, ex);
} catch (InvalidConfigurationException ex) {
if (ex.getCause() instanceof YAMLException) {
Bukkit.getLogger().severe("Config file " + file + " isn't valid! " + ex.getCause());
} else if ((ex.getCause() == null) || (ex.getCause() instanceof ClassCastException)) {
Bukkit.getLogger().severe("Config file " + file + " isn't valid!");
} else {
Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file + ": " + ex.getCause().getClass(), ex);
}
Bukkit.getLogger().log(Level.SEVERE, "Cannot load " + file , ex);
}
return config;
@@ -213,15 +207,9 @@ public class YamlConfiguration extends FileConfiguration {
try {
config.load(stream);
} catch (IOException ex) {
Bukkit.getLogger().log(Level.SEVERE, "Cannot load configuration", ex);
Bukkit.getLogger().log(Level.SEVERE, "Cannot load configuration from stream", ex);
} catch (InvalidConfigurationException ex) {
if (ex.getCause() instanceof YAMLException) {
Bukkit.getLogger().severe("Config file isn't valid! " + ex.getCause());
} else if ((ex.getCause() == null) || (ex.getCause() instanceof ClassCastException)) {
Bukkit.getLogger().severe("Config file isn't valid!");
} else {
Bukkit.getLogger().log(Level.SEVERE, "Cannot load configuration: " + ex.getCause().getClass(), ex);
}
Bukkit.getLogger().log(Level.SEVERE, "Cannot load configuration from stream", ex);
}
return config;