diff options
| author | Rapptz <[email protected]> | 2019-05-24 04:20:42 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-05-24 04:23:06 -0400 |
| commit | d96b8a0b80268adaf51965d86ffcb0c60a05d061 (patch) | |
| tree | 5b348c712cb31a0da914d6ecd92890b611ea7721 | |
| parent | Fix pluralization errors in various files (diff) | |
| download | discord.py-d96b8a0b80268adaf51965d86ffcb0c60a05d061.tar.xz discord.py-d96b8a0b80268adaf51965d86ffcb0c60a05d061.zip | |
Add Discord error code to HTTPException message.
| -rw-r--r-- | discord/errors.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/discord/errors.py b/discord/errors.py index 6669e168..c908a8ac 100644 --- a/discord/errors.py +++ b/discord/errors.py @@ -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. |