Add the message to the exception output.

This commit is contained in:
Rapptz 2015-11-27 03:34:27 -05:00
parent e75edc2e57
commit 4a32ae444a

View File

@ -68,6 +68,15 @@ class HTTPException(DiscordException):
message = httplib.responses.get(response.status_code, 'HTTP error')
message = '{0} (status code: {1.response.status_code})'.format(message, self)
try:
data = response.json()
response_error = data['message']
if response_error:
message = '{}: {}'.format(message, response_error)
except:
pass
super(HTTPException, self).__init__(message)
class InvalidArgument(ClientException):