tinterface was suppressing storage r/w exceptions - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit fecef91ee02352016bcf6990821c2a42e84d2a82 DIR parent cf01788c863e75827e859051560ab9fd2a586ca9 HTML Author: SomberNight <somber.night@protonmail.com> Date: Tue, 21 May 2019 18:11:49 +0200 interface was suppressing storage r/w exceptions Diffstat: M electrum/interface.py | 4 +++- M electrum/storage.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/interface.py b/electrum/interface.py t@@ -28,6 +28,7 @@ import ssl import sys import traceback import asyncio +import socket from typing import Tuple, Union, List, TYPE_CHECKING, Optional from collections import defaultdict from ipaddress import IPv4Network, IPv6Network, ip_address t@@ -332,7 +333,8 @@ class Interface(Logger): return try: await self.open_session(ssl_context) - except (asyncio.CancelledError, OSError, aiorpcx.socks.SOCKSError) as e: + except (asyncio.CancelledError, ConnectionError, socket.gaierror, aiorpcx.socks.SOCKSError) as e: + # note: catching OSError would be too broad here... don't want to catch file system exceptions self.logger.info(f'disconnecting due to: {repr(e)}') return DIR diff --git a/electrum/storage.py b/electrum/storage.py t@@ -58,6 +58,7 @@ class WalletStorage(Logger): DB_Class = JsonDB self.logger.info(f"wallet path {self.path}") self.pubkey = None + # TODO we should test r/w permissions here (whether file exists or not) if self.file_exists(): with open(self.path, "r", encoding='utf-8') as f: self.raw = f.read()