| | |
| | | |
| | | |
| | | |
| | | |
| | | import org.opends.sdk.LocalizableException; |
| | | import org.opends.sdk.LocalizableMessage; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Thrown to indicate that a problem occurred when interacting with the |
| | | * client. For example, if input provided by the client was invalid. |
| | | * Thrown to indicate that a problem occurred when interacting with the client. |
| | | * For example, if input provided by the client was invalid. |
| | | */ |
| | | @SuppressWarnings("serial") |
| | | final class CLIException extends Exception implements |
| | | LocalizableException |
| | | final class CLIException extends Exception implements LocalizableException |
| | | { |
| | | |
| | | /** |
| | | * Adapts any exception that may have occurred whilst reading input |
| | | * from the console. |
| | | * Adapts any exception that may have occurred whilst reading input from the |
| | | * console. |
| | | * |
| | | * @param cause |
| | | * The exception that occurred whilst reading input from the |
| | | * console. |
| | | * @return Returns a new CLI exception describing a problem that |
| | | * occurred whilst reading input from the console. |
| | | * The exception that occurred whilst reading input from the console. |
| | | * @return Returns a new CLI exception describing a problem that occurred |
| | | * whilst reading input from the console. |
| | | */ |
| | | static CLIException adaptInputException(Throwable cause) |
| | | static CLIException adaptInputException(final Throwable cause) |
| | | { |
| | | return new CLIException(Messages.ERR_CONSOLE_INPUT_ERROR.get(cause |
| | | .getMessage()), cause); |
| | |
| | | |
| | | |
| | | |
| | | private final LocalizableMessage message; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new CLI exception with the provided message. |
| | | * |
| | | * @param message |
| | | * The message explaining the problem that occurred. |
| | | */ |
| | | CLIException(LocalizableMessage message) |
| | | CLIException(final LocalizableMessage message) |
| | | { |
| | | super(message.toString()); |
| | | this.message = message; |
| | |
| | | * @param cause |
| | | * The cause of this exception. |
| | | */ |
| | | CLIException(LocalizableMessage message, Throwable cause) |
| | | CLIException(final LocalizableMessage message, final Throwable cause) |
| | | { |
| | | super(message.toString(), cause); |
| | | this.message = message; |
| | |
| | | |
| | | |
| | | |
| | | private final LocalizableMessage message; |
| | | |
| | | |
| | | |
| | | public LocalizableMessage getMessageObject() |
| | | { |
| | | return message; |