Skip to content

Commit

Permalink
Initialize JsonDecodeError before initializing IOError
Browse files Browse the repository at this point in the history
That way we get the formated error message
  • Loading branch information
cHYzZQo committed Jan 7, 2022
1 parent 620ed4f commit 24540e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions requests/exceptions.py
Expand Up @@ -33,6 +33,9 @@ class InvalidJSONError(RequestException):

class JSONDecodeError(InvalidJSONError, CompatJSONDecodeError):
"""Couldn't decode the text into json"""
def __init__(self, *args, **kwargs):
CompatJSONDecodeError.__init__(self, *args)
InvalidJSONError.__init__(self, *self.args, **kwargs)


class HTTPError(RequestException):
Expand Down

0 comments on commit 24540e3

Please sign in to comment.