live: improve logging in image_create

Log the whole context of the error when an exception happens.
The previous exception handling was hidding important information
about the cause of the error.
master
Alejandro Sirgo Rica 2024-03-22 10:26:34 +01:00
parent 97647c32aa
commit 16dcc9b25b
1 changed files with 2 additions and 2 deletions

View File

@ -483,9 +483,9 @@ class OgLiveOperations:
raise RuntimeError(f'Cannot access partclone image file {image_path}')
image_info = ogGetImageInfo(image_path)
except:
except Exception as e:
self._restartBrowser(self._url)
raise RuntimeError(f'Error: Cannot create image for {fstype} filesystem in device {padev}')
raise RuntimeError(f'Failed to create image for {fstype} filesystem in device {padev}: {e}') from e
try:
st = os.stat(image_path)