From 8741b2e2724fabb25465c06c3a4f881d9aa28d67 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 18 Mar 2024 20:26:31 +0100 Subject: src: change generic exception types to be more explicit Replace exception types to be more explicit about the nature of the error. Improve the exception raising semantics by using the 'from' keyword, this wraps an older exception into a new one so it is still considered the same object. --- src/utils/boot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/boot.py b/src/utils/boot.py index c9b12ee..528c052 100644 --- a/src/utils/boot.py +++ b/src/utils/boot.py @@ -52,7 +52,7 @@ def _boot_bios_windows(disk, part, mountpoint): with open(f'{mountpoint}/ogboot.secondboot', 'w') as f: f.write('\0' * (3072)) except OSError as e: - raise RuntimeError(f'Could not create ogboot files in Windows partition: {e}') + raise OSError(f'Could not create ogboot files in Windows partition: {e}') from e def _boot_uefi_windows(disk, part, mountpoint): logging.info(f'Booting windows system') -- cgit v1.2.3-18-g5258