From fffbccff3b74a937306fdf593dbbbc9b884393f0 Mon Sep 17 00:00:00 2001 From: x Date: Mon, 24 Oct 2022 15:45:44 +0000 Subject: [PATCH] make it easier to troubleshoot config parse errors Change the logging message displayed when the config file can't be parsed: include the underlying exception text, so that a user who is attepting to edit the config manually can find and fix any errors. --- electrum/simple_config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/simple_config.py b/electrum/simple_config.py index 10f0215b6..0ecdfa6b7 100644 --- a/electrum/simple_config.py +++ b/electrum/simple_config.py @@ -717,8 +717,8 @@ def read_user_config(path): with open(config_path, "r", encoding='utf-8') as f: data = f.read() result = json.loads(data) - except: - _logger.warning(f"Cannot read config file. {config_path}") + except Exception as exc: + _logger.warning(f"Cannot read config file at {config_path}: {exc}") return {} if not type(result) is dict: return {}