From 4d816c4ef3d2eaa5ffb970b0d1b187bc287f9c4c Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 25 Jan 2016 01:16:14 -0500 Subject: HTTPException now has a text attribute if JSON is not available. --- discord/errors.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'discord/errors.py') 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: -- cgit v1.2.3