Only print broken json in component type when debug mode is enabled (#3990)

This commit is contained in:
EnZaXD 2024-06-28 13:44:31 +02:00 committed by GitHub
parent bfbb80f708
commit f4d6659760
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,9 @@ public class ComponentType extends Type<JsonElement> {
try {
return JsonParser.parseString(s);
} catch (JsonSyntaxException e) {
Via.getPlatform().getLogger().severe("Error when trying to parse json: " + s);
if (Via.getManager().isDebug()) {
Via.getPlatform().getLogger().severe("Error when trying to parse json: " + s);
}
throw e;
}
}