# SSHException (sshj 0.4.1 API)
Date: 2011-06-19

## net.schmizz.sshj.common
Class SSHException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              java.io.IOException
                  net.schmizz.sshj.common.SSHException

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  Buffer.BufferException, ConnectionException, SCPException, SFTPException, TransportException, UserAuthException

    public class SSHException

extends IOException

Most exceptions in the `net.schmizz.sshj` package are instances of this class. An `SSHException` is itself an `IOException` and can be caught like that if this level of granularity is not desired.

See Also:
  Serialized Form

Field Summary
`static ExceptionChainer<SSHException>` `chainer`

Constructor Summary
`SSHException(DisconnectReason code)`
`SSHException(DisconnectReason code, String message)`
`SSHException(DisconnectReason code, String message, Throwable cause)`
`SSHException(DisconnectReason code, Throwable cause)`
`SSHException(String message)`
`SSHException(String message, Throwable cause)`
`SSHException(Throwable cause)`

Method Summary
`DisconnectReason` `getDisconnectReason()`
`String` `getMessage()`
`String` `toString()`

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### chainer

    public static final ExceptionChainer<SSHException> chainer

Constructor Detail

### SSHException

    public SSHException(DisconnectReason code)

### SSHException

    public SSHException(DisconnectReason code,
                        String message)

### SSHException

    public SSHException(DisconnectReason code,
                        String message,
                        Throwable cause)

### SSHException

    public SSHException(DisconnectReason code,
                        Throwable cause)

### SSHException

    public SSHException(String message)

### SSHException

    public SSHException(String message,
                        Throwable cause)

### SSHException

    public SSHException(Throwable cause)

Method Detail

### getDisconnectReason

    public DisconnectReason getDisconnectReason()

### getMessage

    public String getMessage()

  Overrides:
    `getMessage` in class `Throwable`

### toString

    public String toString()

  Overrides:
    `toString` in class `Throwable`

Copyright © 2009-2011. All Rights Reserved.