summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2015-01-09 06:53:00 +0100
committerFlorian Bruhin <git@the-compiler.org>2015-01-09 07:17:47 +0100
commit78f6f3a0e1de939dc6983e57af634d42c003b291 (patch)
treeb106a61385a364ebb2183953654fa2fe19ba771d
parent6166ea51e25ac52e725778dac8532d0731439177 (diff)
downloadqutebrowser-78f6f3a0e1de939dc6983e57af634d42c003b291.tar.gz
qutebrowser-78f6f3a0e1de939dc6983e57af634d42c003b291.zip
Fix error handling for local files in :adblock-update
-rw-r--r--qutebrowser/browser/adblock.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/qutebrowser/browser/adblock.py b/qutebrowser/browser/adblock.py
index c70a3ec93..3784a122b 100644
--- a/qutebrowser/browser/adblock.py
+++ b/qutebrowser/browser/adblock.py
@@ -112,7 +112,7 @@ class HostBlocker:
"Run :adblock-update to get adblock lists.")
@cmdutils.register(instance='host-blocker')
- def adblock_update(self):
+ def adblock_update(self, win_id: {'special': 'win_id'}):
"""Update the adblock block lists."""
self.blocked_hosts = set()
self._done_count = 0
@@ -125,8 +125,10 @@ class HostBlocker:
if url.scheme() == 'file':
try:
fileobj = open(url.path(), 'rb')
- except OSError:
- log.misc.exception("Failed to open block list!")
+ except OSError as e:
+ message.error(win_id, "adblock: Error while reading {}: "
+ "{}".format(url.path(), e.strerror))
+ continue
download = FakeDownload(fileobj)
self._in_progress.append(download)
self.on_download_finished(download)