adds additional exception handling in open() (#18003)

The open() method will now catch a socket.timeout exception and raise
a ShellError.
pull/4420/head
Peter Sprygada 2016-10-13 15:13:00 -04:00 committed by GitHub
parent bce31a11c2
commit b1666020a9
1 changed files with 2 additions and 0 deletions

View File

@ -106,6 +106,8 @@ class Shell(object):
raise ShellError("unable to resolve host name") raise ShellError("unable to resolve host name")
except AuthenticationException: except AuthenticationException:
raise ShellError('Unable to authenticate to remote device') raise ShellError('Unable to authenticate to remote device')
except socket.timeout:
raise ShellError("timeout trying to connect to remote device")
except socket.error: except socket.error:
exc = get_exception() exc = get_exception()
if exc.errno == 60: if exc.errno == 60: