From 651d0c5a544bf599176b0842411fbc3534ac78c4 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Fri, 6 May 2022 07:33:48 -0400 Subject: [PATCH] split catch block in config manager --- .../hideAndSeek/configuration/ConfigManager.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java index 78d5c6e..c844924 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/configuration/ConfigManager.java @@ -79,8 +79,10 @@ public class ConfigManager { this.config = new YamlConfiguration(); try { this.config.load(reader); - } catch(InvalidConfigurationException | IOException e){ + } catch(InvalidConfigurationException e){ throw new RuntimeException("Invalid configuration in config file: "+file.getPath()); + } catch(IOException e){ + throw new RuntimeException("Could not access file: "+file.getPath()); } InputStream input = this.getClass().getClassLoader().getResourceAsStream(defaultFilename); @@ -91,8 +93,10 @@ public class ConfigManager { this.defaultConfig = new YamlConfiguration(); try { this.defaultConfig.load(default_reader); - } catch(InvalidConfigurationException | IOException e){ + } catch(InvalidConfigurationException e){ throw new RuntimeException("Invalid configuration in config file: "+file.getPath()); + } catch(IOException e){ + throw new RuntimeException("Could not access file: "+file.getPath()); } try{