aboutsummaryrefslogtreecommitdiff
path: root/discord/errors.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-01-25 01:16:14 -0500
committerRapptz <[email protected]>2016-01-25 01:16:14 -0500
commit4d816c4ef3d2eaa5ffb970b0d1b187bc287f9c4c (patch)
treee80100f6139a87ccd322696f72f7c3172f498020 /discord/errors.py
parent[commands] Fix discord.Invite special case handling in parameters. (diff)
downloaddiscord.py-4d816c4ef3d2eaa5ffb970b0d1b187bc287f9c4c.tar.xz
discord.py-4d816c4ef3d2eaa5ffb970b0d1b187bc287f9c4c.zip
HTTPException now has a text attribute if JSON is not available.
Diffstat (limited to 'discord/errors.py')
-rw-r--r--discord/errors.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/errors.py b/discord/errors.py
index 3569aae0..62fff0b2 100644
--- a/discord/errors.py
+++ b/discord/errors.py
@@ -54,10 +54,15 @@ class HTTPException(DiscordException):
instance of `aiohttp.ClientResponse`__.
__ http://aiohttp.readthedocs.org/en/stable/client_reference.html#aiohttp.ClientResponse
+
+ .. attribute:: text
+
+ The text of the response if it wasn't JSON. Could be None.
"""
- def __init__(self, response, message=None):
+ def __init__(self, response, message=None, text=None):
self.response = response
+ self.text = text
fmt = '{0.reason} (status code: {0.status})'
if message: