Skip to content

Commit

Permalink
Remove dependency on requests-2.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lavigne958 committed Oct 20, 2024
1 parent 2bad9df commit 623b32b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gspread/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from typing import Any, Mapping

from requests import JSONDecodeError, Response
from requests import Response


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

error = {
"code": -1,
"message": response.text,
"status": "invalid JSON",
"status": "invalid JSON: '{}'".format(e),
}

super().__init__(error)
Expand Down

0 comments on commit 623b32b

Please sign in to comment.