From 9a7bf0a3614d5b42adf96451f51a049b875b8562 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 26 Oct 2017 21:18:16 +1100 Subject: [PATCH] #2254: Explicitly note config issues are not bugs --- proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java index 8d79b5ab..a2b96815 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -27,6 +27,7 @@ import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.util.CaseInsensitiveMap; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.error.YAMLException; public class YamlConfig implements ConfigurationAdapter { @@ -60,7 +61,13 @@ public class YamlConfig implements ConfigurationAdapter try ( InputStream is = new FileInputStream( file ) ) { - config = (Map) yaml.load( is ); + try + { + config = (Map) yaml.load( is ); + } catch ( YAMLException ex ) + { + throw new RuntimeException( "Invalid configuration encountered - this is a configuration error and NOT a bug! Please attempt to fix the error or see https://www.spigotmc.org/ for help.", ex ); + } } if ( config == null )