disk: use different log message in get_disk_data and get_partition_data

Use a more specific message to differentiate the source of the error.

Add the target device to the log message.
master
Alejandro Sirgo Rica 2024-10-25 09:25:51 +02:00
parent 7874323d46
commit 64f1f5403e
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ def get_partition_data(device):
try:
cxt = fdisk.Context(device=device, details=True)
except Exception as e:
raise OgError(f'Partition query error: {e}') from e
raise OgError(f'Partition query error for {device}: {e}') from e
for i, p in enumerate(cxt.partitions):
pd = ogPartitionData(
@ -51,7 +51,7 @@ def get_disk_data(device):
try:
cxt = fdisk.Context(device=device, details=True)
except Exception as e:
raise OgError(f'Partition query error: {e}') from e
raise OgError(f'Disk query error for {device}: {e}') from e
return ogDiskData(
nsectors = cxt.nsectors,
sector_size = cxt.sector_size,