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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user