Package com.sshtools.common.ssh
Class SshException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.sshtools.common.ssh.SshException
- All Implemented Interfaces:
Serializable
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
- Author:
- Lee David Painter
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAn error has occurred within the agent.static final intThe API has encountered an error because of incorrect usage.static final intThe user cancelled the connection.static final intIndicates 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 final intThe connection could not be established.static final intAn attempt has been made to use a connection that has been closed and is no longer valid.static final intAn error has occurred the port forwarding system.static final intAPI error to indicate a host key signature failed.static final intAn 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 final intAn error occurred in the JCE; typically this would result from Maverick attempting to use an algorithm that the JCE does not support.static final intThe protocol failed to negotiate a transport algorithm or failed to verify the host key of the remote host.static final intThe API is not licensed!static final intAn expected message was not received before the specified timeout period.static final intAn error occurred reading the contents of a file.static final intThe Shell class failed to detect the prompt.static final intThe SSH protocol was violated in some way by the remote host and the connection has been terminated.static final intA request was made to allocate a pseudo terminal, but this request failed.static final intThe remote host disconnected following the normal SSH protocol disconnection procedure.static final intThe user cancelled an active SCP transfer.static final intAn error occurred whilst accessing a sessions streamsstatic final intA request was made to start a shell, but this request failed.static final intThe API detected a socket timeoutstatic final intThe connection unexpectedly terminated and so the connection can no longer be used.static final intIn setting up a context an algorithm was specified that is not supported by the API.static final intAn operation was not supported -
Constructor Summary
ConstructorsConstructorDescriptionSshException(int reason, String msg) Create an exception with the given description and reason (for compatibility with Legacy API).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) -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
UNEXPECTED_TERMINATION
public static final int UNEXPECTED_TERMINATIONThe connection unexpectedly terminated and so the connection can no longer be used. The exception message will contain the message from the exception that caused the termination.- See Also:
-
REMOTE_HOST_DISCONNECTED
public static final int REMOTE_HOST_DISCONNECTEDThe remote host disconnected following the normal SSH protocol disconnection procedure. The exception message will contain the message received from the remote host that describes the reason for the disconnection- See Also:
-
PROTOCOL_VIOLATION
public static final int PROTOCOL_VIOLATIONThe SSH protocol was violated in some way by the remote host and the connection has been terminated. The exception message will contain a description of the protocol violation.- See Also:
-
BAD_API_USAGE
public static final int BAD_API_USAGEThe API has encountered an error because of incorrect usage. The state of the connection upon receiving this exception is unknown.- See Also:
-
INTERNAL_ERROR
public static final int INTERNAL_ERRORAn 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.- See Also:
-
CHANNEL_FAILURE
public static final int CHANNEL_FAILUREIndicates 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. Upon receiving this exception you should check the connection state to determine whether its still possible to use the connection.- See Also:
-
UNSUPPORTED_ALGORITHM
public static final int UNSUPPORTED_ALGORITHMIn setting up a context an algorithm was specified that is not supported by the API.- See Also:
-
CANCELLED_CONNECTION
public static final int CANCELLED_CONNECTIONThe user cancelled the connection.- See Also:
-
KEY_EXCHANGE_FAILED
public static final int KEY_EXCHANGE_FAILEDThe protocol failed to negotiate a transport algorithm or failed to verify the host key of the remote host.- See Also:
-
CONNECT_FAILED
public static final int CONNECT_FAILEDThe connection could not be established.- See Also:
-
LICENSE_ERROR
public static final int LICENSE_ERRORThe API is not licensed!- See Also:
-
CONNECTION_CLOSED
public static final int CONNECTION_CLOSEDAn attempt has been made to use a connection that has been closed and is no longer valid.- See Also:
-
AGENT_ERROR
public static final int AGENT_ERRORAn error has occurred within the agent.- See Also:
-
FORWARDING_ERROR
public static final int FORWARDING_ERRORAn error has occurred the port forwarding system.- See Also:
-
PSEUDO_TTY_ERROR
public static final int PSEUDO_TTY_ERRORA request was made to allocate a pseudo terminal, but this request failed.- See Also:
-
SHELL_ERROR
public static final int SHELL_ERRORA request was made to start a shell, but this request failed.- See Also:
-
SESSION_STREAM_ERROR
public static final int SESSION_STREAM_ERRORAn error occurred whilst accessing a sessions streams- See Also:
-
JCE_ERROR
public static final int JCE_ERRORAn error occurred in the JCE; typically this would result from Maverick attempting to use an algorithm that the JCE does not support.- See Also:
-
POSSIBLE_CORRUPT_FILE
public static final int POSSIBLE_CORRUPT_FILEAn error occurred reading the contents of a file. Its possible that the file is not correctly formatted.- See Also:
-
SCP_TRANSFER_CANCELLED
public static final int SCP_TRANSFER_CANCELLEDThe user cancelled an active SCP transfer.- See Also:
-
SOCKET_TIMEOUT
public static final int SOCKET_TIMEOUTThe API detected a socket timeout- See Also:
-
PROMPT_TIMEOUT
public static final int PROMPT_TIMEOUTThe Shell class failed to detect the prompt.- See Also:
-
MESSAGE_TIMEOUT
public static final int MESSAGE_TIMEOUTAn expected message was not received before the specified timeout period.- See Also:
-
HOST_KEY_ERROR
public static final int HOST_KEY_ERRORAPI error to indicate a host key signature failed.- See Also:
-
UNSUPPORTED_OPERATION
public static final int UNSUPPORTED_OPERATIONAn operation was not supported- See Also:
-
-
Constructor Details
-
SshException
Create an exception with the given description and reason.- Parameters:
msg-reason-
-
SshException
Create an exception with the given description and reason (for compatibility with Legacy API).- Parameters:
msg-reason-
-
SshException
Create an exception with the given cause and reason.- Parameters:
reason-cause-
-
SshException
-
SshException
Create an exception with the given description and cause. The reason given will beINTERNAL_ERROR.- Parameters:
msg-cause-
-
SshException
Create an exception by providing the cause of the error. This constructor sets the reason to INTERNAL_ERROR.- Parameters:
cause-
-
SshException
Create an exception with the given description cause, reason.- Parameters:
msg-reason-cause-
-
-
Method Details