commands: Catch an OSErrors for key imports/exports as well.
This commit is contained in:
parent
b1d1871d11
commit
54ad615431
1 changed files with 2 additions and 2 deletions
|
|
@ -695,7 +695,7 @@ def olm_export_command(server, args):
|
||||||
file_path = os.path.expanduser(args.file)
|
file_path = os.path.expanduser(args.file)
|
||||||
try:
|
try:
|
||||||
server.client.export_keys(file_path, args.passphrase)
|
server.client.export_keys(file_path, args.passphrase)
|
||||||
except IOError as e:
|
except (OSError, IOError) as e:
|
||||||
server.error("Error exporting keys: {}".format(str(e)))
|
server.error("Error exporting keys: {}".format(str(e)))
|
||||||
|
|
||||||
server.info("Succesfully exported keys")
|
server.info("Succesfully exported keys")
|
||||||
|
|
@ -704,7 +704,7 @@ def olm_import_command(server, args):
|
||||||
file_path = os.path.expanduser(args.file)
|
file_path = os.path.expanduser(args.file)
|
||||||
try:
|
try:
|
||||||
server.client.import_keys(file_path, args.passphrase)
|
server.client.import_keys(file_path, args.passphrase)
|
||||||
except (IOError, EncryptionError) as e:
|
except (OSError, IOError, EncryptionError) as e:
|
||||||
server.error("Error importing keys: {}".format(str(e)))
|
server.error("Error importing keys: {}".format(str(e)))
|
||||||
|
|
||||||
server.info("Succesfully imported keys")
|
server.info("Succesfully imported keys")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue