Skip to content

Commit

Permalink
Expose x-error-message header via error_message property (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc authored Dec 12, 2022
2 parents 96321fc + 149137b commit 6f68e9b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions trakt/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class TraktInternalException(TraktException):
http_code = 500
message = 'Internal Server Error'

@property
def error_message(self):
return self.response.headers.get("x-error-message", None)


class TraktBadGateway(TraktException):
"""TraktException type to be raised when a 502 error is raised"""
Expand Down

0 comments on commit 6f68e9b

Please sign in to comment.