[Bleeding] Exception cleanup. Addresses BUKKIT-774

This commit is contained in:
Wesley Wolfe
2012-02-18 17:15:59 -06:00
committed by EvilSeph
parent f8804423bf
commit a294e9c246
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;