Skip to content

Commit 64849b7

Browse files
committed
Catch JSONDecodeError instead of all exceptions
1 parent 8746a7d commit 64849b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

googleapiclient/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _get_reason(self):
5050
try:
5151
try:
5252
data = json.loads(self.content.decode("utf-8"))
53-
except:
53+
except json.JSONDecodeError:
5454
# In case it is not json
5555
data = self.content.decode("utf-8")
5656
if isinstance(data, dict):

0 commit comments

Comments
 (0)