Skip to content
Snippets Groups Projects
Commit 75d57d3b authored by Florian Bruhin's avatar Florian Bruhin
Browse files

Fix exceptions when getting JSON

parent 6daac600
No related branches found
No related tags found
No related merge requests found
Pipeline #203678 failed
......@@ -83,9 +83,9 @@ def upload_file(
)
)
except httpx.HTTPError as exc:
data = exc.response.json() # type: ignore[attr-defined]
print(f"[red bold]{exc}[/]", file=sys.stderr)
try:
data = exc.response.json() # type: ignore[attr-defined]
print(f"[red]Error: {data.get('error')}[/]", file=sys.stderr)
print(f"[red]Message: {data.get('msg')}[/]", file=sys.stderr)
timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment