#2254: Explicitly note config issues are not bugs

This commit is contained in:
md_5 2017-10-26 21:18:16 +11:00
parent ec4279eeb4
commit 9a7bf0a361

View File

@ -27,6 +27,7 @@ import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.util.CaseInsensitiveMap; import net.md_5.bungee.util.CaseInsensitiveMap;
import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
public class YamlConfig implements ConfigurationAdapter public class YamlConfig implements ConfigurationAdapter
{ {
@ -59,8 +60,14 @@ public class YamlConfig implements ConfigurationAdapter
file.createNewFile(); file.createNewFile();
try ( InputStream is = new FileInputStream( file ) ) try ( InputStream is = new FileInputStream( file ) )
{
try
{ {
config = (Map) yaml.load( is ); 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 ) if ( config == null )