jsch icon indicating copy to clipboard operation
jsch copied to clipboard

Throw specific exceptions at least for connect and authentication

Open erik-wramner opened this issue 1 year ago • 0 comments

JSch always throws the same checked exception for any errors. In some cases that is fine, but in others it is a pain. Specifically, when connecting to a host, it would be nice to know if the connection fails because the host does not exist or is down or if a TCP connection was established and something went wrong in a later stage. It would also be very useful to know if the connection failed due to an invalid user or password, as the application should typically not retry (again - the library itself retries authentications) as that can lock the account.

Gradually converting the code to throw sub-classes of the existing exception with known meanings would be a great improvement.

erik-wramner avatar Jul 09 '23 15:07 erik-wramner