mirror of https://github.com/huashengdun/webssh
Generate clear error message for invalid unencrypted key
parent
2b8b978ca2
commit
a274a88e7e
|
@ -81,10 +81,11 @@ class PrivateKey(object):
|
|||
raise InvalidValueError('Need a password to decrypt the key.')
|
||||
except paramiko.SSHException as exc:
|
||||
logging.error(str(exc))
|
||||
raise InvalidValueError(
|
||||
'Invalid key or wrong password "{}" for decrypting it.'
|
||||
.format(self.password)
|
||||
)
|
||||
msg = 'Invalid key'
|
||||
if self.password:
|
||||
msg += ' or wrong password "{}" for decrypting it.'.format(
|
||||
self.password)
|
||||
raise InvalidValueError(msg)
|
||||
|
||||
|
||||
class MixinHandler(object):
|
||||
|
|
Loading…
Reference in New Issue