String variableName = option.name();
Optional<String> value = environment.getValue(variableName);
if (option.required() && !value.isPresent()) {
- throw new RequiredOptionIsMissing();
+ throw new RequiredOptionIsMissing(option.name());
}
field.setAccessible(true);
try {
return new Parser(new SystemEnvironment());
}
- public static class RequiredOptionIsMissing extends RuntimeException { }
+ public static class RequiredOptionIsMissing extends RuntimeException {
+
+ public RequiredOptionIsMissing(String message) {
+ super(message);
+ }
+
+ }
}