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() return await response.json()
except Exception as e: except Exception as e:
self._log(f"JSON parse error: {e}") self._log(f"JSON parse error: {e}")
try: # For methods like DELETE that may return 200 with no body, return None
text = await response.text() return None
self._log(f"Response text: {text}")
except Exception as text_e:
self._log(f"Error getting response text: {text_e}")
raise
else: else:
return None return None
except aiohttp.ClientError as e: except aiohttp.ClientError as e: