Skip to content

Commit 623b32b

Browse files
committed
Remove dependency on requests-2.27.0
1 parent 2bad9df commit 623b32b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gspread/exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from typing import Any, Mapping
1010

11-
from requests import JSONDecodeError, Response
11+
from requests import Response
1212

1313

1414
class UnSupportedExportFormat(Exception):
@@ -42,15 +42,15 @@ class APIError(GSpreadException):
4242
def __init__(self, response: Response):
4343
try:
4444
error = response.json()["error"]
45-
except JSONDecodeError:
45+
except Exception as e:
4646
# in case we failed to parse the error from the API
4747
# build an empty error object to notify the caller
4848
# and keep the exception raise flow running
4949

5050
error = {
5151
"code": -1,
5252
"message": response.text,
53-
"status": "invalid JSON",
53+
"status": "invalid JSON: '{}'".format(e),
5454
}
5555

5656
super().__init__(error)

0 commit comments

Comments
 (0)