fix: handle error correctly with aiohttp upgrade
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user