-
Notifications
You must be signed in to change notification settings - Fork 440
Closed
Milestone
Description
Extract missing fields information from MissingParameterException in case of the exception.
Example:
public static class DefaultExceptionHandler implements IExceptionHandler {
public List<Object> handleException(ParameterException ex, PrintStream out, Help.Ansi ansi, String... args) {
if (ex instanceof MissingParameterException) {
MissingParameterException missingParameterException = (MissingParameterException) ex;
out.println("Missing parameters: " + missingParameterException.getMissingFields());
} else if (ex instanceof UnmatchedArgumentException) {
out.println("Unknown parameters:" + ex.getCommandLine().getUnmatchedArguments());
} else {
out.println(ex.getMessage());
}
return Collections.emptyList();
}
}
Proposal:
Add the method getMissingFields
that returns the associated missing fields.