Fix display of errors while reading the key config file

Also catch `cmdexc.CommandError` on startup to show these errors in the
alert dialog on startup.

Fixes #1340
This commit is contained in:
Martin Tournoij 2017-04-04 09:50:12 +01:00
parent 0de3b5460e
commit c5427a0127
No known key found for this signature in database
GPG Key ID: A6258419189EE585
2 changed files with 3 additions and 2 deletions

View File

@ -186,7 +186,8 @@ def _init_key_config(parent):
key_config = keyconf.KeyConfigParser(standarddir.config(), 'keys.conf',
args.relaxed_config,
parent=parent)
except (keyconf.KeyConfigError, UnicodeDecodeError) as e:
except (keyconf.KeyConfigError, cmdexc.CommandError,
UnicodeDecodeError) as e:
log.init.exception(e)
errstr = "Error while reading key config:\n"
if e.lineno is not None:

View File

@ -322,7 +322,7 @@ class KeyConfigParser(QObject):
else:
line = line.strip()
self._read_command(line)
except KeyConfigError as e:
except (KeyConfigError, cmdexc.CommandError) as e:
if relaxed:
continue
else: