fix: handle error correctly with aiohttp upgrade

This commit is contained in:
2026-03-02 17:41:43 +01:00
parent 4ef3de646e
commit 49ab62bb2c
2 changed files with 18 additions and 3 deletions

View File

@@ -100,19 +100,19 @@ class Wallabag(object):
json_data = {}
if responses.status != 200:
err_msg = HttpProcessingError(code=responses.status,
message=await responses.json())
message=str(await responses.json()))
logging.error("Wallabag: aiohttp error {err_msg}".format(
err_msg=err_msg))
else:
try:
json_data = responses.json()
json_data = await responses.json()
except ClientResponseError as e:
# sometimes json_data does not return any json() without
# any error. This is due to the grabbing URL which "rejects"
# the URL
logging.error("Wallabag: aiohttp error {code} {message}"
.format(code=e.code, message=e.message))
return await json_data
return json_data
@staticmethod
def __get_attr(what, type_attr, value_attr, **kwargs):