add better error message

This commit is contained in:
Dr. Matthias Ratajczak
2022-05-04 11:32:35 +02:00
parent 3cf5daa335
commit 457697f15a
+2 -2
View File
@@ -605,8 +605,7 @@ class Cryptsetup(CommandInterface):
device = Path(line.split(":")[-1].strip()) device = Path(line.split(":")[-1].strip())
break break
else: else:
# TODO better error message print(Messages.CANNOT_FIND_DEVICE_PATH)
print("panic")
exit(EXIT_ERROR) exit(EXIT_ERROR)
# noinspection PyUnboundLocalVariable # noinspection PyUnboundLocalVariable
return device return device
@@ -830,6 +829,7 @@ class CommandRunner:
class Messages: class Messages:
ALREADY_DECRYPTED = "Cannot decrypt, already decrypted" ALREADY_DECRYPTED = "Cannot decrypt, already decrypted"
ALREADY_IMPORTED = "Cannot import, already imported" ALREADY_IMPORTED = "Cannot import, already imported"
CANNOT_FIND_DEVICE_PATH = "Cannot find device path from output of `cryptsetup status`"
CANNOT_FIND_BACKUP_DRIVE = "Could not find a backup drive" CANNOT_FIND_BACKUP_DRIVE = "Could not find a backup drive"
DELETE_IN_LOCAL_POOL = "ALERT! Tried to delete in local pool!" DELETE_IN_LOCAL_POOL = "ALERT! Tried to delete in local pool!"
MAPPER_ENTRY_ALREADY_EXISTS = "mapper entry already exists" MAPPER_ENTRY_ALREADY_EXISTS = "mapper entry already exists"