mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Add the message to the exception output.
This commit is contained in:
parent
e75edc2e57
commit
4a32ae444a
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user