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.")
Thanks! Handling this in an unified way is a bit of a pain for qutebrowser now, but it was the right thing to do and I suppose at some point we can drop support for < 0.5.0.
Currently, users have to parse the error string, which is not ideal. See https://github.com/qutebrowser/qutebrowser/commit/7da7110bc73170647d4c48520f639e3fd2e2e802