Skip to content

Commit

Permalink
Catch JSONDecodeError instead of all exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
parthea committed Dec 9, 2020
1 parent 8746a7d commit 64849b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion googleapiclient/errors.py
Expand Up @@ -50,7 +50,7 @@ def _get_reason(self):
try:
try:
data = json.loads(self.content.decode("utf-8"))
except:
except json.JSONDecodeError:
# In case it is not json
data = self.content.decode("utf-8")
if isinstance(data, dict):
Expand Down

0 comments on commit 64849b7

Please sign in to comment.