From afc77ab61d5d1ec46b04843331ef4e2ea20a93d3 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 27 Feb 2026 15:45:08 +0100 Subject: [PATCH] jw.pkg.lib.util.run_curl(): Beautify logging Make some incomprensible parser error messages if run_curl() returns nothing slightly less incomprehensible. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/jw/pkg/lib/util.py b/src/python/jw/pkg/lib/util.py index f916b4cc..8ccef402 100644 --- a/src/python/jw/pkg/lib/util.py +++ b/src/python/jw/pkg/lib/util.py @@ -230,12 +230,13 @@ async def run_curl(args: list[str], parse_json: bool=True, wd=None, throw=None, try: return json.loads(ret) except Exception as e: - size = 'None' + size = 'unknown number of' try: size = len(ret) except: pass - print(f'Failed to parse {size} bytes output of command >{pretty_cmd(cmd, wd)}< ({str(e)})', file=sys.stderr) + print(f'Failed to parse {size} bytes output of command ' + + f'>{pretty_cmd(cmd, wd)}< ({str(e)}): "{ret}"', file=sys.stderr) raise return ret