Commit c79031b2 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[master] Fix exception types caught

parent 6674553c
......@@ -604,7 +604,7 @@ class SecureHTTPServer(socketserver_mixin.NoPollMixIn,
self.close_request(sock)
logger.error(CMDCTL_SSL_SETUP_FAILURE_USER_DENIED, err)
raise
except (CmdctlException, IOError) as cce:
except (CmdctlException, IOError, socket.error) as cce:
self.close_request(sock)
logger.error(CMDCTL_SSL_SETUP_FAILURE_READING_CERT, cce)
raise
......
......@@ -737,7 +737,7 @@ class TestSecureHTTPServer(unittest.TestCase):
'no_such_file', 'no_such_file')
# Using a non-certificate file would cause an SSLError
self.assertRaises(ssl.SSLError,
self.assertRaises(socket.error,
self.server._wrap_socket_in_ssl_context,
sock,
BUILD_FILE_PATH + 'cmdctl.py',
......@@ -756,7 +756,7 @@ class TestSecureHTTPServer(unittest.TestCase):
orig_check_func = self.server._check_key_and_cert
try:
self.server._check_key_and_cert = lambda x,y: None
self.assertRaises(socket.error,
self.assertRaises(IOError,
self.server._wrap_socket_in_ssl_context,
sock,
'no_such_file', 'no_such_file')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment