Skip to content

Commit 6dc1e79

Browse files
committed
Cover for __getitem__ as well
1 parent 3171b61 commit 6dc1e79

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

airbyte_cdk/sources/streams/http/http_client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,18 @@ def send_request(
522522

523523

524524
class SkipFailureSQLiteDict(requests_cache.backends.sqlite.SQLiteDict):
525+
def __getitem__(self, key): # type: ignore # lib is not typed
526+
try:
527+
return super().__getitem__(key) # type: ignore # lib is not typed
528+
except Exception as exception:
529+
logger.warning(f"Error while retrieving item from cache: {exception}")
530+
525531
def _write(self, key: str, value: str) -> None:
526532
try:
527533
super()._write(key, value) # type: ignore # lib is not typed
528534
except Exception as exception:
529-
logger.warning(exception)
535+
logger.warning(f"Error while saving item to cache: {exception}")
536+
530537

531538

532539
class SkipFailureSQLiteCache(requests_cache.backends.sqlite.SQLiteCache):

0 commit comments

Comments
 (0)