From 6b2509b1064de5d73c3e3cb4ed9ee8b52df3137d Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 10 Sep 2018 01:09:35 +0200 Subject: [PATCH] interface.run: catch OSError instead of subtypes --- electrum/interface.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/electrum/interface.py b/electrum/interface.py index 718fe6a14..6368cf230 100644 --- a/electrum/interface.py +++ b/electrum/interface.py @@ -147,7 +147,7 @@ class Interface(PrintError): async def _try_saving_ssl_cert_for_first_time(self, ca_ssl_context): try: ca_signed = await self.is_server_ca_signed(ca_ssl_context) - except (ConnectionRefusedError, socket.gaierror, aiorpcx.socks.SOCKSFailure) as e: + except (OSError, aiorpcx.socks.SOCKSFailure) as e: raise ErrorGettingSSLCertFromServer(e) from e if ca_signed: with open(self.cert_path, 'w') as f: @@ -211,8 +211,7 @@ class Interface(PrintError): return try: await self.open_session(ssl_context, exit_early=False) - except (asyncio.CancelledError, ConnectionRefusedError, socket.gaierror, - ssl.SSLError, TimeoutError, aiorpcx.socks.SOCKSFailure) as e: + except (asyncio.CancelledError, OSError, aiorpcx.socks.SOCKSFailure) as e: self.print_error('disconnecting due to: {}'.format(e)) self.exception = e return