aboutsummaryrefslogtreecommitdiff
path: root/common/src/main/java/dev/isxander/yacl3/config/v2
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/dev/isxander/yacl3/config/v2')
-rw-r--r--common/src/main/java/dev/isxander/yacl3/config/v2/impl/ConfigClassHandlerImpl.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/src/main/java/dev/isxander/yacl3/config/v2/impl/ConfigClassHandlerImpl.java b/common/src/main/java/dev/isxander/yacl3/config/v2/impl/ConfigClassHandlerImpl.java
index 4851da7..dd14ed0 100644
--- a/common/src/main/java/dev/isxander/yacl3/config/v2/impl/ConfigClassHandlerImpl.java
+++ b/common/src/main/java/dev/isxander/yacl3/config/v2/impl/ConfigClassHandlerImpl.java
@@ -102,7 +102,13 @@ public class ConfigClassHandlerImpl<T> implements ConfigClassHandler<T> {
.name(Component.translatable("yacl3.config.%s.category.%s.group.%s".formatted(id().toString(), autoGen.category(), k)));
});
- Option<?> option = createOption(configField, storage);
+ Option<?> option;
+ try {
+ option = createOption(configField, storage);
+ } catch (Exception e) {
+ throw new YACLAutoGenException("Failed to create option for field '%s'".formatted(configField.access().name()), e);
+ }
+
storage.putOption(configField.access().name(), option);
group.option(option);
});