aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-06-12 20:44:40 -0400
committerRapptz <[email protected]>2016-06-12 20:44:40 -0400
commit6b5d579d0bdbe4b2f3beb19168b57db162f24dcd (patch)
treefe527b74f2e88549e054b1837c38986afeaa39d7
parentMake HTTPException get the error JSON's message attribute. (diff)
downloaddiscord.py-6b5d579d0bdbe4b2f3beb19168b57db162f24dcd.tar.xz
discord.py-6b5d579d0bdbe4b2f3beb19168b57db162f24dcd.zip
Remove unused verify response function.
-rw-r--r--discord/utils.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/discord/utils.py b/discord/utils.py
index 99c76ca5..55ee30a8 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -218,24 +218,6 @@ def _unique(iterable):
def _null_event(*args, **kwargs):
pass
-def _verify_successful_response(response):
- code = response.status
- success = code >= 200 and code < 300
- if not success:
- message = None
- if response.headers['content-type'] == 'application/json':
- data = yield from response.json(encoding='utf-8')
- message = data.get('message')
- else:
- message = yield from response.text(encoding='utf-8')
-
- if code == 403:
- raise Forbidden(response, message)
- elif code == 404:
- raise NotFound(response, message)
- raise HTTPException(response, message)
-
def _get_mime_type_for_image(data):
if data.startswith(b'\x89\x50\x4E\x47\x0D\x0A\x1A\x0A'):
return 'image/png'