Bladeren bron

Add more error messages

Lortseam 4 jaren geleden
bovenliggende
commit
8fe651afaa

+ 2 - 4
src/main/java/me/lortseam/completeconfig/ConfigHandler.java

@@ -82,8 +82,7 @@ public final class ConfigHandler {
         try {
             return loader.load();
         } catch (ConfigurateException e) {
-            //TODO
-            e.printStackTrace();
+            LOGGER.error("[CompleteConfig] Failed to load config from file!", e);
         }
         return CommentedConfigurationNode.root();
     }
@@ -115,8 +114,7 @@ public final class ConfigHandler {
         try {
             loader.save(root);
         } catch (ConfigurateException e) {
-            //TODO
-            e.printStackTrace();
+            LOGGER.error("[CompleteConfig] Failed to save config to file!", e);
         }
     }
 

+ 3 - 5
src/main/java/me/lortseam/completeconfig/data/Entry.java

@@ -221,8 +221,7 @@ public class Entry<T> extends EntryBase<T> implements DataPart {
         try {
             setValue((T) node.get(type));
         } catch (SerializationException e) {
-            //TODO
-            e.printStackTrace();
+            LOGGER.error("[CompleteConfig] Failed to apply value to entry!", e);
         }
     }
 
@@ -231,8 +230,7 @@ public class Entry<T> extends EntryBase<T> implements DataPart {
         try {
             node.set(type, getValue());
         } catch (SerializationException e) {
-            //TODO
-            e.printStackTrace();
+            LOGGER.error("[CompleteConfig] Failed to fetch value from entry!", e);
         }
     }
 
@@ -246,7 +244,7 @@ public class Entry<T> extends EntryBase<T> implements DataPart {
         static <T> Draft<T> of(Field field) {
             EntryBase<T> accessor = (EntryBase<T>) Entry.of(field);
             if (!(accessor instanceof Draft)) {
-                throw new UnsupportedOperationException("Entry draft of " + field + " was already built");
+                throw new UnsupportedOperationException("Entry draft of field " + field + " was already built");
             }
             return (Draft<T>) accessor;
         }