From 457697f15a1c61cee6c24826bce9944aac9134a9 Mon Sep 17 00:00:00 2001 From: "Dr. Matthias Ratajczak" Date: Wed, 4 May 2022 11:32:35 +0200 Subject: [PATCH] add better error message --- zfs_backup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zfs_backup.py b/zfs_backup.py index 5aa748d..42a2bd9 100755 --- a/zfs_backup.py +++ b/zfs_backup.py @@ -605,8 +605,7 @@ class Cryptsetup(CommandInterface): device = Path(line.split(":")[-1].strip()) break else: - # TODO better error message - print("panic") + print(Messages.CANNOT_FIND_DEVICE_PATH) exit(EXIT_ERROR) # noinspection PyUnboundLocalVariable return device @@ -830,6 +829,7 @@ class CommandRunner: class Messages: ALREADY_DECRYPTED = "Cannot decrypt, already decrypted" 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" DELETE_IN_LOCAL_POOL = "ALERT! Tried to delete in local pool!" MAPPER_ENTRY_ALREADY_EXISTS = "mapper entry already exists"