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:
Andreas Troelsen 2018-06-16 18:23:02 +02:00
parent a834246cbd
commit 2404bb478d

View File

@ -221,8 +221,10 @@ public class MobArena extends JavaPlugin
yaml.load(file);
ConfigUtils.addMissingRemoveObsolete(file, Msg.toYaml(), yaml);
Msg.load(yaml);
} catch (Exception e) {
e.printStackTrace();
} catch (IOException e) {
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());
}
}