Subject: | login method and others should return an value for catching errors |
The login method should return 0 (false) to indicate that the login
failed due to some error.
A call to a "getLastError" method should return what that error was.
Also when establishing the connection if it fails for some reason then
an ssh object should be returned, but it should not be connected. Then
a check like:
if(defined($ssh->getLastError)) {
handle connection based error
could be used.
Also the cmd method should return undef if a fundamental error occurs
(like connection lost) and set the getLastError value.
It may also be useful to have a clearLastError method.
The documentation should provide a brief example of catching the
possible errors.