diff --git a/tldextract/cache.py b/tldextract/cache.py index 7f6d5d0..62880b8 100644 --- a/tldextract/cache.py +++ b/tldextract/cache.py @@ -113,8 +113,7 @@ def get(self, namespace: str, key: str | dict[str, Hashable]) -> object: with open(cache_filepath) as cache_file: return json.load(cache_file) except (OSError, ValueError) as exc: - LOG.error("error reading TLD cache file %s: %s", cache_filepath, exc) - raise KeyError("namespace: " + namespace + " key: " + repr(key)) from None + raise KeyError("namespace: " + namespace + " key: " + repr(key)) from exc def set( # noqa: A003 self, namespace: str, key: str | dict[str, Hashable], value: object diff --git a/tldextract/suffix_list.py b/tldextract/suffix_list.py index 192f633..154f79f 100644 --- a/tldextract/suffix_list.py +++ b/tldextract/suffix_list.py @@ -47,7 +47,9 @@ def find_first_response( session=session, url=url, timeout=cache_fetch_timeout ) except requests.exceptions.RequestException: - LOG.exception("Exception reading Public Suffix List url %s", url) + LOG.warning( + "Exception reading Public Suffix List url %s", url, exc_info=True + ) finally: # Ensure the session is always closed if it's constructed in the method if session_created: