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 |
CIPHER_ERROR
An error occurred in a cipher
|
static int |
COMPRESSION_ERROR
An error occurred during compression
|
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 |
FAILED_NEGOTIATION
The API failed to negotiate a suitable algorithm
|
static int |
FORWARDING_ERROR
An error has occurred the port forwarding system.
|
static int |
HOST_KEY_ERROR
API error to indicate a host key signature failed.
|
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_ERROR
An error occurred during key exchange
|
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 |
KEY_EXCHANGE_RETRY
Instruction to retry the existing key exchange.
|
static int |
LICENSE_ERROR
The API is not licensed!
|
static int |
MAC_ERROR
An error occurred in a hmac.
|
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 |
PROBALITY_KEX_TOO_LARGE
Internal error to indicate the kex init was probably too large for the remote to handle.
|
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_EOF_IN_KEYEXCHANGE
An operation was not supported
|
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.
|
static int |
UNSUPPORTED_OPERATION
An operation was not supported
|
Constructor and Description |
---|
SshException(int reason,
String component)
For internal use to raise a component exception
|
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,
List<IncompatibleAlgorithm> incompatible) |
SshException(String msg,
int reason,
String component)
Create an exception with the given description and reason.
|
SshException(String msg,
int reason,
Throwable cause) |
SshException(String msg,
int reason,
Throwable cause,
String component)
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.
|
String |
getComponent()
Return the component that generated the error.
|
Collection<IncompatibleAlgorithm> |
getIncompatibleAlgorithms() |
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 static final int CIPHER_ERROR
public static final int MAC_ERROR
public static final int KEY_EXCHANGE_ERROR
public static final int COMPRESSION_ERROR
public static final int HOST_KEY_ERROR
public static final int FAILED_NEGOTIATION
public static final int UNSUPPORTED_OPERATION
public static final int UNEXPECTED_EOF_IN_KEYEXCHANGE
public static final int PROBALITY_KEX_TOO_LARGE
public static final int KEY_EXCHANGE_RETRY
public SshException(int reason, String component)
reason
- component
- public SshException(String msg, int reason)
msg
- reason
- public SshException(String msg, int reason, List<IncompatibleAlgorithm> incompatible)
public SshException(String msg, int reason, String component)
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
- public SshException(String msg, int reason, Throwable cause)
msg
- reason
- cause
- public int getReason()
public Throwable getCause()
public String getComponent()
public Collection<IncompatibleAlgorithm> getIncompatibleAlgorithms()
Copyright © 2024. All rights reserved.