Fix for issue 2889 (Java exception from dsconfig when answering ^D (ctrl-D) (EOT) in interactive mode)
The fix consists in not throwing a RuntimeException but a CLIException (the code assumed that there was a serious issue and did not consider this case). With the fix the behavior of MenuBuilder is similar to the one of LDAPConnectionConsoleInteraction.
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.util.cli; |
| | | |
| | |
| | | } |
| | | |
| | | // Get the user's choice. |
| | | MenuCallback<T> choice; |
| | | try { |
| | | choice = app.readValidatedInput(promptMsg, validator); |
| | | } catch (CLIException e) { |
| | | // Should never happen. |
| | | throw new RuntimeException(e); |
| | | } |
| | | MenuCallback<T> choice = app.readValidatedInput(promptMsg, validator); |
| | | |
| | | // Invoke the user's selected choice. |
| | | MenuResult<T> result = choice.invoke(app); |