Package org.kohsuke.args4j

## Class CmdLineException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.kohsuke.args4j.CmdLineException

All Implemented Interfaces:
  `java.io.Serializable`

    public class CmdLineException
    extends java.lang.Exception

Signals an error in the user input.

Author:
  Kohsuke Kawaguchi
See Also:
  Serialized Form

### Constructor Summary

Constructors
`CmdLineException​(java.lang.String message)` Deprecated. Use `CmdLineException(CmdLineParser, String)`
`CmdLineException​(java.lang.String message, java.lang.Throwable cause)` Deprecated. Use `CmdLineException(CmdLineParser, String, Throwable)`
`CmdLineException​(java.lang.Throwable cause)` Deprecated. Use `CmdLineException(CmdLineParser, Throwable)`
`CmdLineException​(CmdLineParser parser, java.lang.String message)` Deprecated. Use `CmdLineException(org.kohsuke.args4j.CmdLineParser, Localizable, java.lang.String...)`
`CmdLineException​(CmdLineParser parser, java.lang.String message, java.lang.Throwable cause)`
`CmdLineException​(CmdLineParser parser, java.lang.Throwable cause)`
`CmdLineException​(CmdLineParser parser, Localizable message, java.lang.String... args)`

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `getLocalizedMessage()`
`CmdLineParser` `getParser()` Obtains the `CmdLineParser` that triggered an exception.

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### CmdLineException

    public CmdLineException​(java.lang.String message)

Deprecated.
Use `CmdLineException(CmdLineParser, String)`

#### CmdLineException

    public CmdLineException​(java.lang.String message,
                            java.lang.Throwable cause)

Deprecated.
Use `CmdLineException(CmdLineParser, String, Throwable)`

#### CmdLineException

    public CmdLineException​(java.lang.Throwable cause)

Deprecated.
Use `CmdLineException(CmdLineParser, Throwable)`

#### CmdLineException

    public CmdLineException​(CmdLineParser parser,
                            Localizable message,
                            java.lang.String... args)

#### CmdLineException

    public CmdLineException​(CmdLineParser parser,
                            java.lang.String message)

Deprecated.
Use `CmdLineException(org.kohsuke.args4j.CmdLineParser, Localizable, java.lang.String...)`

#### CmdLineException

    public CmdLineException​(CmdLineParser parser,
                            java.lang.String message,
                            java.lang.Throwable cause)

#### CmdLineException

    public CmdLineException​(CmdLineParser parser,
                            java.lang.Throwable cause)

### Method Detail

#### getLocalizedMessage

    public java.lang.String getLocalizedMessage()

Overrides:
  `getLocalizedMessage` in class `java.lang.Throwable`

#### getParser

    public CmdLineParser getParser()

Obtains the `CmdLineParser` that triggered an exception.

Unless you have legacy `OptionHandler` that doesn't pass in this information when it throws an exception, this method should always return a non-null value.