add better error message
This commit is contained in:
+2
-2
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user