Hide item deserialization errors unless using development branch (fixes #550)

This commit is contained in:
Intelli 2024-06-17 18:49:43 -06:00
parent 957bf70c26
commit aaa7a3536a
2 changed files with 13 additions and 4 deletions

View File

@ -65,7 +65,7 @@ public class EntityStatement {
resultSet.close(); resultSet.close();
} }
catch (Exception e) { // only display this exception on development branch catch (Exception e) { // only display exception on development branch
if (!ConfigHandler.EDITION_BRANCH.contains("-dev")) { if (!ConfigHandler.EDITION_BRANCH.contains("-dev")) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -586,9 +586,18 @@ public class Util extends Queue {
return result; return result;
} }
public static ItemMeta deserializeItemMeta(Class<? extends ItemMeta> itemMetaClass, Map<String, Object> args) { public static ItemMeta deserializeItemMetax(Class<? extends ItemMeta> itemMetaClass, Map<String, Object> args) {
DelegateDeserialization delegate = itemMetaClass.getAnnotation(DelegateDeserialization.class); try {
return (ItemMeta) ConfigurationSerialization.deserializeObject(args, delegate.value()); DelegateDeserialization delegate = itemMetaClass.getAnnotation(DelegateDeserialization.class);
return (ItemMeta) ConfigurationSerialization.deserializeObject(args, delegate.value());
}
catch (Exception e) { // only display exception on development branch
if (!ConfigHandler.EDITION_BRANCH.contains("-dev")) {
e.printStackTrace();
}
}
return null;
} }
public static <K, V extends Comparable<? super V>> SortedSet<Map.Entry<K, V>> entriesSortedByValues(Map<K, V> map) { public static <K, V extends Comparable<? super V>> SortedSet<Map.Entry<K, V>> entriesSortedByValues(Map<K, V> map) {