Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/filesystem.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/disk/filesystem.py')
-rw-r--r--archinstall/lib/disk/filesystem.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
index 5d5952a0..af5879aa 100644
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -189,10 +189,13 @@ class Filesystem:
return True
def raw_parted(self, string: str) -> SysCommand:
- if (cmd_handle := SysCommand(f'/usr/bin/parted -s {string}')).exit_code != 0:
- log(f"Parted ended with a bad exit code: {cmd_handle}", level=logging.ERROR, fg="red")
- time.sleep(0.5)
- return cmd_handle
+ try:
+ cmd_handle = SysCommand(f'/usr/bin/parted -s {string}')
+ time.sleep(0.5)
+ return cmd_handle
+ except SysCallError as error:
+ log(f"Parted ended with a bad exit code: {error.exit_code} ({error})", level=logging.ERROR, fg="red")
+ return error
def parted(self, string: str) -> bool:
"""
@@ -282,6 +285,7 @@ class Filesystem:
log(f"Could not find the new PARTUUID after adding the partition.", level=logging.ERROR, fg="red")
log(f"Previous partitions: {previous_partuuids}", level=logging.ERROR, fg="red")
log(f"New partitions: {total_partitions}", level=logging.ERROR, fg="red")
+
raise DiskError(f"Could not add partition using: {parted_string}")
def set_name(self, partition: int, name: str) -> bool: