Log OSError for PDF.js more explicitly

Closes #4289
This commit is contained in:
Florian Bruhin 2018-10-04 16:53:15 +02:00
parent 659be2296f
commit 5514ddeed5

View File

@ -25,7 +25,7 @@ import os
from PyQt5.QtCore import QUrl, QUrlQuery from PyQt5.QtCore import QUrl, QUrlQuery
from qutebrowser.utils import (utils, javascript, jinja, qtutils, usertypes, from qutebrowser.utils import (utils, javascript, jinja, qtutils, usertypes,
standarddir) standarddir, log)
from qutebrowser.misc import objects from qutebrowser.misc import objects
from qutebrowser.config import config from qutebrowser.config import config
@ -203,7 +203,10 @@ def _read_from_system(system_path, names):
full_path = os.path.join(system_path, name) full_path = os.path.join(system_path, name)
with open(full_path, 'rb') as f: with open(full_path, 'rb') as f:
return (f.read(), full_path) 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 continue
return (None, None) return (None, None)