diff options
| author | Rapptz <[email protected]> | 2016-06-12 13:57:05 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-06-12 13:57:05 -0400 |
| commit | fa36a449e9d33e60cf6b15b58378453870fd33f0 (patch) | |
| tree | 23939755433cdc2f76dfb50f1609a66f24c9a7c8 /discord/utils.py | |
| parent | [commands] Make the CommandError required argument optional again. (diff) | |
| download | discord.py-fa36a449e9d33e60cf6b15b58378453870fd33f0.tar.xz discord.py-fa36a449e9d33e60cf6b15b58378453870fd33f0.zip | |
Change HTTPException to only take a single parameter.
Diffstat (limited to 'discord/utils.py')
| -rw-r--r-- | discord/utils.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/discord/utils.py b/discord/utils.py index d9e7bddd..99c76ca5 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -224,18 +224,17 @@ def _verify_successful_response(response): success = code >= 200 and code < 300 if not success: message = None - text = None if response.headers['content-type'] == 'application/json': data = yield from response.json(encoding='utf-8') message = data.get('message') else: - text = yield from response.text(encoding='utf-8') + message = yield from response.text(encoding='utf-8') if code == 403: - raise Forbidden(response, message, text) + raise Forbidden(response, message) elif code == 404: - raise NotFound(response, message, text) - raise HTTPException(response, message, text) + 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'): |