interface: catch more SOCKS exceptions
This commit is contained in:
@@ -207,7 +207,7 @@ class Interface(PrintError):
|
|||||||
async def _try_saving_ssl_cert_for_first_time(self, ca_ssl_context):
|
async def _try_saving_ssl_cert_for_first_time(self, ca_ssl_context):
|
||||||
try:
|
try:
|
||||||
ca_signed = await self.is_server_ca_signed(ca_ssl_context)
|
ca_signed = await self.is_server_ca_signed(ca_ssl_context)
|
||||||
except (OSError, aiorpcx.socks.SOCKSFailure) as e:
|
except (OSError, aiorpcx.socks.SOCKSError) as e:
|
||||||
raise ErrorGettingSSLCertFromServer(e) from e
|
raise ErrorGettingSSLCertFromServer(e) from e
|
||||||
if ca_signed:
|
if ca_signed:
|
||||||
with open(self.cert_path, 'w') as f:
|
with open(self.cert_path, 'w') as f:
|
||||||
@@ -284,7 +284,7 @@ class Interface(PrintError):
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
await self.open_session(ssl_context)
|
await self.open_session(ssl_context)
|
||||||
except (asyncio.CancelledError, OSError, aiorpcx.socks.SOCKSFailure) as e:
|
except (asyncio.CancelledError, OSError, aiorpcx.socks.SOCKSError) as e:
|
||||||
self.print_error('disconnecting due to: {}'.format(repr(e)))
|
self.print_error('disconnecting due to: {}'.format(repr(e)))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user