From f589750a3cff6f061bc4b78ef857e52a7fbc874c Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 14 Mar 2021 12:16:46 +0100 Subject: Tweaked SysCallError() exception to include the exit code in a machine readable manner. Since it's useful as an indicator where calls might go wrong and for what reason. --- archinstall/lib/exceptions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'archinstall/lib/exceptions.py') diff --git a/archinstall/lib/exceptions.py b/archinstall/lib/exceptions.py index 5a5d47c6..558a397d 100644 --- a/archinstall/lib/exceptions.py +++ b/archinstall/lib/exceptions.py @@ -7,7 +7,10 @@ class UnknownFilesystemFormat(BaseException): class ProfileError(BaseException): pass class SysCallError(BaseException): - pass + def __init__(self, message, error_code): + super(SysCallError, self).__init__(message) + self.message = message + self.error_code = error_code class ProfileNotFound(BaseException): pass class HardwareIncompatibilityError(BaseException): -- cgit v1.2.3-70-g09d2 From 2ef7be9787c4d3acb91f91308acf7bf5c8715c1a Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 14 Mar 2021 12:17:30 +0100 Subject: Wrong variable name. --- archinstall/lib/exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'archinstall/lib/exceptions.py') diff --git a/archinstall/lib/exceptions.py b/archinstall/lib/exceptions.py index 558a397d..a320eef6 100644 --- a/archinstall/lib/exceptions.py +++ b/archinstall/lib/exceptions.py @@ -7,10 +7,10 @@ class UnknownFilesystemFormat(BaseException): class ProfileError(BaseException): pass class SysCallError(BaseException): - def __init__(self, message, error_code): + def __init__(self, message, exit_code): super(SysCallError, self).__init__(message) self.message = message - self.error_code = error_code + self.exit_code = exit_code class ProfileNotFound(BaseException): pass class HardwareIncompatibilityError(BaseException): -- cgit v1.2.3-70-g09d2