Skip to content

Commit

Permalink
Add Discord error code to HTTPException message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed May 24, 2019
1 parent fc5a293 commit d96b8a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions discord/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ def __init__(self, response, message):
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.
Expand Down

0 comments on commit d96b8a0

Please sign in to comment.