public class SshException extends Exception
Generic exception for J2SSH Maverick exception handling. When an exception is thrown a reason is attached to the exception so that the developer can determine if its possible to proceed with the connection.
This
Modifier and Type | Field and Description |
---|---|
static int |
AGENT_ERROR
An error has occurred within the agent.
|
static int |
BAD_API_USAGE
The API has encountered an error because of incorrect usage.
|
static int |
CANCELLED_CONNECTION
The user cancelled the connection.
|
static int |
CHANNEL_FAILURE
Indicates that a channel has failed; this is used by channel
implementations (such as port forwarding or session channels) to indicate
that the channel has critically failed.
|
static int |
CONNECT_FAILED
The connection could not be established.
|
static int |
CONNECTION_CLOSED
An attempt has been made to use a connection that has been closed and is
no longer valid.
|
static int |
FORWARDING_ERROR
An error has occurred the port forwarding system.
|
static int |
INTERNAL_ERROR
An internal error occurred within the API; in all cases contact
sshtools.com support with the details of this error and the state of the
connection when receiving this exception is unknown.
|
static int |
JCE_ERROR
An error occurred in the JCE; typically this would result from Maverick
attempting to use an algorithm that the JCE does not support.
|
static int |
KEY_EXCHANGE_FAILED
The protocol failed to negotiate a transport algorithm or failed to
verify the host key of the remote host.
|
static int |
LICENSE_ERROR
The API is not licensed!
|
static int |
MESSAGE_TIMEOUT
An expected message was not received before the specified timeout period.
|
static int |
POSSIBLE_CORRUPT_FILE
An error occurred reading the contents of a file.
|
static int |
PROMPT_TIMEOUT
The Shell class failed to detect the prompt.
|
static int |
PROTOCOL_VIOLATION
The SSH protocol was violated in some way by the remote host and the
connection has been terminated.
|
static int |
PSEUDO_TTY_ERROR
A request was made to allocate a pseudo terminal, but this request
failed.
|
static int |
REMOTE_HOST_DISCONNECTED
The remote host disconnected following the normal SSH protocol
disconnection procedure.
|
static int |
SCP_TRANSFER_CANCELLED
The user cancelled an active SCP transfer.
|
static int |
SESSION_STREAM_ERROR
An error occurred whilst accessing a sessions streams
|
static int |
SHELL_ERROR
A request was made to start a shell, but this request failed.
|
static int |
SOCKET_TIMEOUT
The API detected a socket timeout
|
static int |
UNEXPECTED_TERMINATION
The connection unexpectedly terminated and so the connection can no
longer be used.
|
static int |
UNSUPPORTED_ALGORITHM
In setting up a context an algorithm was specified that is not supported
by the API.
|
Constructor and Description |
---|
SshException(int reason,
Throwable cause)
Create an exception with the given cause and reason.
|
SshException(String msg,
int reason)
Create an exception with the given description and reason.
|
SshException(String msg,
int reason,
Throwable cause)
Create an exception with the given description cause, reason.
|
SshException(String msg,
Throwable cause)
Create an exception with the given description and cause.
|
SshException(Throwable cause)
Create an exception by providing the cause of the error.
|
SshException(Throwable cause,
int reason) |
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
If an INTERNAL_ERROR reason is given this method MAY return the cause of
the error.
|
int |
getReason()
Get the reason for the exception
|
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final int UNEXPECTED_TERMINATION
public static final int REMOTE_HOST_DISCONNECTED
public static final int PROTOCOL_VIOLATION
public static final int BAD_API_USAGE
public static final int INTERNAL_ERROR
public static final int CHANNEL_FAILURE
public static final int UNSUPPORTED_ALGORITHM
public static final int CANCELLED_CONNECTION
public static final int KEY_EXCHANGE_FAILED
public static final int CONNECT_FAILED
public static final int LICENSE_ERROR
public static final int CONNECTION_CLOSED
public static final int AGENT_ERROR
public static final int FORWARDING_ERROR
public static final int PSEUDO_TTY_ERROR
public static final int SHELL_ERROR
public static final int SESSION_STREAM_ERROR
public static final int JCE_ERROR
public static final int POSSIBLE_CORRUPT_FILE
public static final int SCP_TRANSFER_CANCELLED
public static final int SOCKET_TIMEOUT
public static final int PROMPT_TIMEOUT
public static final int MESSAGE_TIMEOUT
public SshException(String msg, int reason)
msg
- reason
- public SshException(int reason, Throwable cause)
reason
- cause
- public SshException(Throwable cause, int reason)
public SshException(String msg, Throwable cause)
INTERNAL_ERROR
.msg
- cause
- public SshException(Throwable cause)
cause
- Copyright © 2014. All rights reserved.