fix: guard JSON parsing on upload response for non-JSON success bodies

This commit is contained in:
DrMelone 2026-04-12 23:01:17 +02:00
parent 4cbbe73376
commit b2b0702eea

View file

@ -2965,7 +2965,10 @@ async def upload_file_to_terminal(
return json.dumps(
{'error': f'Upload failed (HTTP {response.status}): {detail}'}
)
result = await response.json()
try:
result = await response.json()
except Exception:
result = {}
return json.dumps(
{