mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +02:00
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 <jan@janware.com>
This commit is contained in:
parent
efa6e1bad7
commit
afc77ab61d
1 changed files with 3 additions and 2 deletions
|
|
@ -230,12 +230,13 @@ async def run_curl(args: list[str], parse_json: bool=True, wd=None, throw=None,
|
||||||
try:
|
try:
|
||||||
return json.loads(ret)
|
return json.loads(ret)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
size = 'None'
|
size = 'unknown number of'
|
||||||
try:
|
try:
|
||||||
size = len(ret)
|
size = len(ret)
|
||||||
except:
|
except:
|
||||||
pass
|
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
|
raise
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue