diff --git a/TODO b/TODO index f4f467512..1d013a3cb 100644 --- a/TODO +++ b/TODO @@ -6,9 +6,6 @@ Weird font rendering https://bugreports.qt-project.org/browse/QTBUG-20973 https://bugreports.qt-project.org/browse/QTBUG-21036 Changing completion models is awfully slow -new keybinding (not in config) crashes exception handler - Also, what about unknown settings, unknown values, wrong interpolations, - etc.? values written to config are unordered values starting with ; need to be escaped diff --git a/qutebrowser/app.py b/qutebrowser/app.py index e3dedb28b..e3224a2de 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -108,12 +108,17 @@ class QuteBrowser(QApplication): confdir = self._args.confdir try: config.init(confdir) - except config.ValidationError as e: - msgbox = QMessageBox( - QMessageBox.Critical, - "Error while reading config!", - "Error while reading config:\n\n{} -> {}:\n{}".format( - e.section, e.option, e)) + except (config.ValidationError, + configparser.InterpolationError, + configparser.DuplicateSectionError, + configparser.DuplicateOptionError, + configparser.ParsingError) as e: + errstr = "Error while reading config:" + if hasattr(e, 'section') and hasattr(e, 'option'): + errstr += "\n\n{} -> {}:".format(e.section, e.option) + errstr += "\n{}".format(e) + msgbox = QMessageBox(QMessageBox.Critical, + "Error while reading config!", errstr) msgbox.exec_() # We didn't really initialize much so far, so we just quit hard. sys.exit(1)