def _handle_fb_response(self, response: aiohttp.ClientResponse):
"""
Check that Facebook was OK with the API call we just made and raise
an exception if it failed.
"""
ok = response.status == 200
if not ok:
# noinspection PyBroadException
try:
error = (await response.json())['error']['message']
except Exception:
error = '(nothing)'
raise PlatformOperationError('Facebook says: "{}"'
.format(error))
评论列表
文章目录