mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2026-02-04 10:14:15 +02:00
Handle aiohttp compatible exc
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import cachetools
|
import cachetools
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import typing
|
import typing
|
||||||
import json
|
|
||||||
import os
|
import os
|
||||||
import abc
|
import abc
|
||||||
|
|
||||||
@@ -149,7 +148,7 @@ class DiscordOAuth2HttpClient(abc.ABC):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
return await response.json()
|
return await response.json()
|
||||||
except json.JSONDecodeError:
|
except aiohttp.ContentTypeError:
|
||||||
return await response.text()
|
return await response.text()
|
||||||
|
|
||||||
async def bot_request(self, route: str, method="GET", **kwargs) -> typing.Union[dict, str]:
|
async def bot_request(self, route: str, method="GET", **kwargs) -> typing.Union[dict, str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user