Avoid crash if ddrescue-tui is run offline

This commit is contained in:
2Shirt 2024-03-23 23:06:17 -07:00
parent 25b18ebabc
commit fe21d10c98
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -88,11 +88,15 @@ def mount_backup_shares(read_write: bool = False) -> list[str]:
continue
# Mount share
proc = mount_network_share(details, mount_point, read_write=read_write)
if proc.returncode:
try:
proc = mount_network_share(details, mount_point, read_write=read_write)
if proc.returncode:
report.append(f'Failed to Mount {mount_str}')
else:
report.append(f'Mounted {mount_str}')
except RuntimeError:
# Assuming we're not connected to a network?
report.append(f'Failed to Mount {mount_str}')
else:
report.append(f'Mounted {mount_str}')
# Done
return report