mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-08 08:02:13 -07:00
SPIGOT-6885: Add test and easier to debug code for reference in yaml configuration comments
By: Wolf2323 <gabrielpatrikurban@gmail.com>
This commit is contained in:
@@ -100,11 +100,14 @@ public class YamlConfiguration extends FileConfiguration {
|
||||
|
||||
MappingNode node;
|
||||
try (Reader reader = new UnicodeReader(new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8)))) {
|
||||
node = (MappingNode) yaml.compose(reader);
|
||||
} catch (YAMLException | IOException e) {
|
||||
Node rawNode = yaml.compose(reader);
|
||||
try {
|
||||
node = (MappingNode) rawNode;
|
||||
} catch (ClassCastException e) {
|
||||
throw new InvalidConfigurationException("Top level is not a Map.");
|
||||
}
|
||||
} catch (YAMLException | IOException | ClassCastException e) {
|
||||
throw new InvalidConfigurationException(e);
|
||||
} catch (ClassCastException e) {
|
||||
throw new InvalidConfigurationException("Top level is not a Map.");
|
||||
}
|
||||
|
||||
this.map.clear();
|
||||
|
Reference in New Issue
Block a user