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.
This commit is contained in:
@@ -717,8 +717,8 @@ def read_user_config(path):
|
|||||||
with open(config_path, "r", encoding='utf-8') as f:
|
with open(config_path, "r", encoding='utf-8') as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
result = json.loads(data)
|
result = json.loads(data)
|
||||||
except:
|
except Exception as exc:
|
||||||
_logger.warning(f"Cannot read config file. {config_path}")
|
_logger.warning(f"Cannot read config file at {config_path}: {exc}")
|
||||||
return {}
|
return {}
|
||||||
if not type(result) is dict:
|
if not type(result) is dict:
|
||||||
return {}
|
return {}
|
||||||
|
|||||||
Reference in New Issue
Block a user