Handle OSError in brave adblock
(cherry picked from commit 09c848fe34bd61fca74c6191ff5e49dbbf9ae101)
This commit is contained in:
parent
2859be73ce
commit
4e849d234d
|
|
@ -203,7 +203,13 @@ class BraveAdBlocker:
|
|||
|
||||
def read_cache(self) -> None:
|
||||
"""Initialize the adblocking engine from cache file."""
|
||||
if self._cache_path.is_file():
|
||||
try:
|
||||
cache_exists = self._cache_path.is_file()
|
||||
except OSError:
|
||||
logger.error("Failed to read adblock cache", exc_info=True)
|
||||
return
|
||||
|
||||
if cache_exists:
|
||||
logger.debug("Loading cached adblock data: %s", self._cache_path)
|
||||
self._engine.deserialize_from_file(str(self._cache_path))
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in New Issue