From 478c4447be20380c5b173f8e150d2373cf6d021b Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Wed, 14 Feb 2024 12:20:46 +0100 Subject: src: improve error check in image_create and image_restore cover more error cases where exceptions need to be raised. check return code in the invoked subprocess. restoreImageCustom has been intentionally left behind, it is unclear what this custom script returns on success and error. --- src/utils/disk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utils/disk.py') diff --git a/src/utils/disk.py b/src/utils/disk.py index e26983c..1f1fdab 100644 --- a/src/utils/disk.py +++ b/src/utils/disk.py @@ -33,4 +33,4 @@ def get_partition_device(disknum, partnum): if pa.partno == partnum - 1: return cxt.partition_to_string(pa, fdisk.FDISK_FIELD_DEVICE) - raise ValueError('No such partition') + raise ValueError(f'No such partition with disk index {disknum} and partition index {partnum}') -- cgit v1.2.3-18-g5258