From d1ef9c7286dbb241bf3fc072065edef3b20421c1 Mon Sep 17 00:00:00 2001 From: isXander Date: Tue, 15 Aug 2023 17:33:16 +0100 Subject: Re-throw exceptions when creating options --- .../dev/isxander/yacl3/config/v2/impl/ConfigClassHandlerImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'common/src/main/java/dev/isxander/yacl3/config') 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 implements ConfigClassHandler { .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); }); -- cgit