Package org.apache.commons.cli
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
Base for Exceptions thrown during parsing of a command-line.
- See Also:
-
Constructor Summary
ConstructorDescriptionParseException
(String message) Constructs a newParseException
with the specified detail message.Constructs a newParseException
wrapping the specified exception. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParseException
Converts any exception exceptUnsupportedOperationException
to aParseException
.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ParseException
Constructs a newParseException
with the specified detail message.- Parameters:
message
- the detail message
-
ParseException
Constructs a newParseException
wrapping the specified exception.- Parameters:
e
- the Exception to wrap.
-
-
Method Details
-
wrap
Converts any exception exceptUnsupportedOperationException
to aParseException
. ife
is an instance ofParseException
it is returned, otherwise aParseException
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
-