Skip to content

Commit

Permalink
[Core] Better error message in yaml config
Browse files Browse the repository at this point in the history
  • Loading branch information
NPi2Loup committed May 17, 2024
1 parent cb98e59 commit 3fb8e37
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ private void handleYamlModuleConfig(final String featuresClassName, final YamlMo
.forEach(feature -> {
Assertion.check()
.isFalse(feature.containsKey(FLAGS), "can't read flags as intended in feature {0} (module's flags: {1})", featuresClassName, yamlModuleConfig.__flags__)
.isTrue(feature.size() == 1, "a feature is designed by it's class");
.isTrue(feature.size() > 0, "missing feature")
.isTrue(feature.size() == 1, "a feature '{0}' should be designed by it's class only (may add indents)", feature.keySet().iterator().next());
final Map.Entry<String, Map<String, Object>> featureEntry = feature.entrySet().iterator().next();
final String featureClassName = featureEntry.getKey();
final Method methodForFeature = featureMethods.get(featureClassName);
Expand All @@ -220,7 +221,8 @@ private void handleYamlModuleConfig(final String featuresClassName, final YamlMo
.forEach(featureConfig -> {
Assertion.check()
.isFalse(featureConfig.containsKey(FLAGS), "can't read flags as intended in featureConfig {0} (module's flags: {1})", featuresClassName, yamlModuleConfig.__flags__)
.isTrue(featureConfig.size() == 1, "a feature is designed by it's class");
.isTrue(featureConfig.size() > 0, "missing featureConfig")
.isTrue(featureConfig.size() == 1, "a featureConfig '{0}' should be designed by it's name only (may add indents)", featureConfig.keySet().iterator().next());
final Map.Entry<String, Map<String, Object>> featureEntry = featureConfig.entrySet().iterator().next();
final String featureClassName = featureEntry.getKey();
final Method methodForFeature = featureMethods.get(featureClassName);
Expand Down

0 comments on commit 3fb8e37

Please sign in to comment.