Improve predicate reading error handling

This commit is contained in:
Eclipse 2024-12-16 15:24:53 +00:00
parent fe8336a2b1
commit f44f368f96
No known key found for this signature in database
GPG key ID: 95E6998F82EC938A

View file

@ -195,13 +195,9 @@ public class MappingsReader_v2 extends MappingsReader {
if (node.isObject()) {
readPredicate(builder, node);
} else if (node.isArray()) {
node.forEach(predicate -> {
try {
readPredicate(builder, predicate);
} catch (InvalidCustomMappingsFileException e) {
GeyserImpl.getInstance().getLogger().error("Error in reading predicate", e); // TODO log this better
}
});
for (JsonNode predicate : node) {
readPredicate(builder, predicate);
}
} else {
throw new InvalidCustomMappingsFileException("Expected predicate key to be a list of predicates or a predicate");
}