We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bad9df commit 623b32bCopy full SHA for 623b32b
gspread/exceptions.py
@@ -8,7 +8,7 @@
8
9
from typing import Any, Mapping
10
11
-from requests import JSONDecodeError, Response
+from requests import Response
12
13
14
class UnSupportedExportFormat(Exception):
@@ -42,15 +42,15 @@ class APIError(GSpreadException):
42
def __init__(self, response: Response):
43
try:
44
error = response.json()["error"]
45
- except JSONDecodeError:
+ except Exception as e:
46
# in case we failed to parse the error from the API
47
# build an empty error object to notify the caller
48
# and keep the exception raise flow running
49
50
error = {
51
"code": -1,
52
"message": response.text,
53
- "status": "invalid JSON",
+ "status": "invalid JSON: '{}'".format(e),
54
}
55
56
super().__init__(error)
0 commit comments