Skip to content

Commit 3aeaedf

Browse files
committed
Add __str__ to OAuthRefreshException
1 parent d553d5e commit 3aeaedf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

trakt/errors.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ def _response_json(response):
109109

110110
return data
111111

112+
def __str__(self):
113+
if self.error and self.error_description:
114+
return f'{self.message}: {self.error} - {self.error_description}'
115+
116+
if self.error:
117+
return f'{self.message}: {self.error}'
118+
119+
return self.message
112120

113121
class ForbiddenException(TraktException):
114122
"""TraktException type to be raised when a 403 return code is received"""

0 commit comments

Comments
 (0)