From 163e4d9eaf1ff0499821c15929cf197bf9cd2968 Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Sun, 21 Aug 2022 20:44:41 +0200 Subject: [PATCH] Fix error handling of SongodaYamlConfig#load(Reader) --- .../configuration/songoda/SongodaYamlConfig.java | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/Core/src/main/java/com/songoda/core/configuration/songoda/SongodaYamlConfig.java b/Core/src/main/java/com/songoda/core/configuration/songoda/SongodaYamlConfig.java index d09bf4b4..d78fad5d 100644 --- a/Core/src/main/java/com/songoda/core/configuration/songoda/SongodaYamlConfig.java +++ b/Core/src/main/java/com/songoda/core/configuration/songoda/SongodaYamlConfig.java @@ -150,21 +150,10 @@ public class SongodaYamlConfig extends YamlConfiguration { } @Override - public void load(Reader reader) { + public void load(Reader reader) throws IOException { super.load(reader); - // FIXME: The interface does not allow to throw an exception, so we log it instead. - try { - upgradeOldConfigVersion(); - } catch (IOException ex) { - if (ex.getMessage().startsWith(this.cannotCreateBackupCopyExceptionPrefix)) { - // Failed to create backup copy, but we can still continue. - this.logger.log(Level.SEVERE, null, ex); - } else { - // This is a real unexpected exception, so we rethrow it. - throw new IllegalStateException(ex); - } - } + upgradeOldConfigVersion(); for (ConfigEntry entry : this.configEntries.values()) { if (entry.get() == null && entry.getDefaultValue() != null) {