diff options
author | Florian Bruhin <me@the-compiler.org> | 2018-10-04 16:53:15 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2018-10-04 16:57:43 +0200 |
commit | 280968c0751cd28572168ce321e9ee0b79a5e50f (patch) | |
tree | 748fb4c47ab92d31868d4bc9613f5b1eb3002652 | |
parent | 6b63bfb7675bf2c4d65d721a810d9d6b19a7d03a (diff) | |
download | qutebrowser-280968c0751cd28572168ce321e9ee0b79a5e50f.tar.gz qutebrowser-280968c0751cd28572168ce321e9ee0b79a5e50f.zip |
Log OSError for PDF.js more explicitly
Closes #4289
(cherry picked from commit 5514ddeed5daa077f8f6933543ec9bcbbdd13143)
-rw-r--r-- | qutebrowser/browser/pdfjs.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qutebrowser/browser/pdfjs.py b/qutebrowser/browser/pdfjs.py index eb9f503e1..706e12fc3 100644 --- a/qutebrowser/browser/pdfjs.py +++ b/qutebrowser/browser/pdfjs.py @@ -25,7 +25,7 @@ import os from PyQt5.QtCore import QUrl, QUrlQuery from qutebrowser.utils import (utils, javascript, jinja, qtutils, usertypes, - standarddir) + standarddir, log) from qutebrowser.misc import objects from qutebrowser.config import config @@ -203,7 +203,10 @@ def _read_from_system(system_path, names): full_path = os.path.join(system_path, name) with open(full_path, 'rb') as f: return (f.read(), full_path) - except OSError: + except FileNotFoundError: + continue + except OSError as e: + log.misc.warning("OSError while reading PDF.js file: {}".format(e)) continue return (None, None) |