Throw an exception if the announcements-file fails to load.
This makes errors in the announcements-file more visible, both during initial load and during reloads.
This commit is contained in:
@@ -221,8 +221,10 @@ public class MobArena extends JavaPlugin
|
|||||||
yaml.load(file);
|
yaml.load(file);
|
||||||
ConfigUtils.addMissingRemoveObsolete(file, Msg.toYaml(), yaml);
|
ConfigUtils.addMissingRemoveObsolete(file, Msg.toYaml(), yaml);
|
||||||
Msg.load(yaml);
|
Msg.load(yaml);
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
throw new RuntimeException("There was an error reading the announcements-file:\n" + e.getMessage());
|
||||||
|
} catch (InvalidConfigurationException e) {
|
||||||
|
throw new RuntimeException("\n\n>>>\n>>> There is an error in your announements-file! Handle it!\n>>> Here's what snakeyaml says:\n>>>\n\n" + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user