Skip to content

Commit d2eca74

Browse files
committed
SSH2: improve exceptions for some types of login errors
1 parent 64c90c8 commit d2eca74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Exscript/protocols/ssh2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def _paramiko_auth(self, username, password):
269269
method(username, password)
270270
return
271271
except BadHostKeyException as e:
272-
msg = 'Bad host key: ' + str(e)
272+
msg = '%s: Bad host key: %s' % (method.__name__, str(e))
273273
self._dbg(1, msg)
274274
errors.append(msg)
275275
except AuthenticationException as e:
@@ -278,7 +278,7 @@ def _paramiko_auth(self, username, password):
278278
self._dbg(1, msg)
279279
errors.append(msg)
280280
except SSHException as e:
281-
msg = 'Missing host key: ' + str(e)
281+
msg = '%s: SSHException: %s' % (method.__name__, str(e))
282282
self._dbg(1, msg)
283283
errors.append(msg)
284284
raise LoginFailure('Login failed: ' + '; '.join(errors))

0 commit comments

Comments
 (0)