Skip to content

Commit

Permalink
fix: key casing for node data, exception message propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertik committed Dec 5, 2024
1 parent ec14615 commit 862a38b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void deserialize(@NotNull T nodeData, @NotNull String input) throws Illeg

log.fine("Key: " + key + ", value: " + value);

PropertyDeserializer<T> deserializer = properties.get(key);
PropertyDeserializer<T> deserializer = properties.get(key.toLowerCase());

if (deserializer == null) {
throw new IllegalArgumentException(String.format("Unknown node data property %s in part %s. Valid properties: '%s'.", key, dataPart, String.join("', '", this.properties.keySet())));
Expand All @@ -116,7 +116,7 @@ public void deserialize(@NotNull T nodeData, @NotNull String input) throws Illeg
try {
deserializer.deserialize(nodeData, value);
} catch (Exception e) {
throw new IllegalArgumentException(String.format("Invalid value '%s' for property %s.", value, key), e);
throw new IllegalArgumentException(String.format("Invalid value for property %s: %s", key, e.getMessage()), e);
}
}
}
Expand Down

0 comments on commit 862a38b

Please sign in to comment.