Class ParseException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.commons.cli.ParseException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AlreadySelectedException, MissingArgumentException, MissingOptionException, UnrecognizedOptionException

public class ParseException extends Exception
Base for Exceptions thrown during parsing of a command-line.
See Also:
  • Constructor Details

    • ParseException

      public ParseException(String message)
      Constructs a new ParseException with the specified detail message.
      Parameters:
      message - the detail message
    • ParseException

      Constructs a new ParseException wrapping the specified exception.
      Parameters:
      e - the Exception to wrap.
  • Method Details

    • wrap

      Converts any exception except UnsupportedOperationException to a ParseException. if e is an instance of ParseException it is returned, otherwise a ParseException is created that wraps it.

      Note: UnsupportedOperationException are not wrapped. This is to solve a legacy expected exception problem and will be removed in the future.

      Parameters:
      e - the exception to convert.
      Returns:
      the ParseException.
      Throws:
      UnsupportedOperationException - due to legacy expectations. Will be removed in the future.
      Since:
      1.7.0