diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-06-01 11:43:00 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-06-01 16:49:30 +0200 |
commit | f1661cf655a98c8737c90432c94cc71bf1311903 (patch) | |
tree | 2686fba18905f71f6a8840fd38dbae995ab0a6e7 | |
parent | 67e0500e61400c68b38400602b389ce1798d4690 (diff) | |
download | qutebrowser-f1661cf655a98c8737c90432c94cc71bf1311903.tar.gz qutebrowser-f1661cf655a98c8737c90432c94cc71bf1311903.zip |
brave adblock: Handle DeserializationError
Fixes #6489
(cherry picked from commit 9ff9fd0a0244aa8ffc2fb56cbb7ba445d75f0b9c)
-rw-r--r-- | qutebrowser/components/braveadblock.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/qutebrowser/components/braveadblock.py b/qutebrowser/components/braveadblock.py index 0a39d5491..bd30f5d29 100644 --- a/qutebrowser/components/braveadblock.py +++ b/qutebrowser/components/braveadblock.py @@ -211,7 +211,15 @@ class BraveAdBlocker: if cache_exists: logger.debug("Loading cached adblock data: %s", self._cache_path) - self._engine.deserialize_from_file(str(self._cache_path)) + try: + self._engine.deserialize_from_file(str(self._cache_path)) + except ValueError as e: + if str(e) != "DeserializationError": + # All Rust exceptions get turned into a ValueError by + # python-adblock + raise + message.error("Reading adblock filter data failed (corrupted data?). " + "Please run :adblock-update.") else: if ( config.val.content.blocking.adblock.lists |