Fix Advoware API call to return None on JSON parse error instead of raising, for methods like DELETE that return 200 with no body.

This commit is contained in:
root
2025-10-23 10:56:44 +00:00
parent 96fa1f58f5
commit a58e6d10a6

View File

@@ -147,12 +147,8 @@ class AdvowareAPI:
return await response.json()
except Exception as e:
self._log(f"JSON parse error: {e}")
try:
text = await response.text()
self._log(f"Response text: {text}")
except Exception as text_e:
self._log(f"Error getting response text: {text_e}")
raise
# For methods like DELETE that may return 200 with no body, return None
return None
else:
return None
except aiohttp.ClientError as e: