mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Add Discord error code to HTTPException message.
This commit is contained in:
parent
fc5a2936dd
commit
d96b8a0b80
@ -104,11 +104,11 @@ class HTTPException(DiscordException):
|
||||
self.text = message
|
||||
self.code = 0
|
||||
|
||||
fmt = '{0.reason} (status code: {0.status})'
|
||||
fmt = '{0.status} {0.reason} (error code: {1})'
|
||||
if len(self.text):
|
||||
fmt = fmt + ': {1}'
|
||||
fmt = fmt + ': {2}'
|
||||
|
||||
super().__init__(fmt.format(self.response, self.text))
|
||||
super().__init__(fmt.format(self.response, self.code, self.text))
|
||||
|
||||
class Forbidden(HTTPException):
|
||||
"""Exception that's thrown for when status code 403 occurs.
|
||||
|
Loading…
x
Reference in New Issue
Block a user