This commit is contained in:
Florian Bruhin 2014-09-09 18:32:18 +02:00
parent 91514ad6c0
commit 414ab88a0e
2 changed files with 11 additions and 2 deletions

View File

@ -103,6 +103,7 @@ class Application(QApplication):
self.modeman = None self.modeman = None
self.cmd_history = None self.cmd_history = None
self.config = None self.config = None
self.keyconfig = None
sys.excepthook = self._exception_hook sys.excepthook = self._exception_hook
@ -195,7 +196,7 @@ class Application(QApplication):
except keyconfparser.KeyConfigError as e: except keyconfparser.KeyConfigError as e:
log.init.exception(e) log.init.exception(e)
errstr = "Error while reading key config:\n" errstr = "Error while reading key config:\n"
if hasattr(e, 'lineno'): if e.lineno is not None:
errstr += "In line {}: ".format(e.lineno) errstr += "In line {}: ".format(e.lineno)
errstr += str(e) errstr += str(e)
msgbox = QMessageBox(QMessageBox.Critical, msgbox = QMessageBox(QMessageBox.Critical,

View File

@ -29,7 +29,15 @@ from qutebrowser.utils import log
class KeyConfigError(Exception): class KeyConfigError(Exception):
"""Raised on errors with the key config.""" """Raised on errors with the key config.
Attributes:
lineno: The config line in which the exception occured.
"""
def __init__(self):
super().__init__()
self.lineno = None
class KeyConfigParser: class KeyConfigParser: