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:
parent
0de3b5460e
commit
c5427a0127
@ -186,7 +186,8 @@ def _init_key_config(parent):
|
|||||||
key_config = keyconf.KeyConfigParser(standarddir.config(), 'keys.conf',
|
key_config = keyconf.KeyConfigParser(standarddir.config(), 'keys.conf',
|
||||||
args.relaxed_config,
|
args.relaxed_config,
|
||||||
parent=parent)
|
parent=parent)
|
||||||
except (keyconf.KeyConfigError, UnicodeDecodeError) as e:
|
except (keyconf.KeyConfigError, cmdexc.CommandError,
|
||||||
|
UnicodeDecodeError) 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 e.lineno is not None:
|
if e.lineno is not None:
|
||||||
|
@ -322,7 +322,7 @@ class KeyConfigParser(QObject):
|
|||||||
else:
|
else:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
self._read_command(line)
|
self._read_command(line)
|
||||||
except KeyConfigError as e:
|
except (KeyConfigError, cmdexc.CommandError) as e:
|
||||||
if relaxed:
|
if relaxed:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user