From 3b3456b6f9b3ddd6be5da6a8dad53243f6793c73 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 7 Jul 2020 22:24:56 +0000 Subject: Added a raise on sys_command exit code being bad. Also updated readme to show how to test this locally --- archinstall/lib/exceptions.py | 2 ++ archinstall/lib/general.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'archinstall') diff --git a/archinstall/lib/exceptions.py b/archinstall/lib/exceptions.py index 9d033147..68ba8750 100644 --- a/archinstall/lib/exceptions.py +++ b/archinstall/lib/exceptions.py @@ -3,4 +3,6 @@ class RequirementError(BaseException): class DiskError(BaseException): pass class ProfileError(BaseException): + pass +class SysCallError(BaseException): pass \ No newline at end of file diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 88cfc047..31f81413 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -233,8 +233,9 @@ class sys_command():#Thread): self.exit_code = 0 if self.exit_code != 0 and not self.kwargs['surpress_errors']: - log(f"'{self.raw_cmd}' did not exit gracefully, exit code {self.exit_code}.", origin='spawn', level=3) - log(self.trace_log.decode('UTF-8'), origin='spawn', level=3) + log(f"'{self.raw_cmd}' did not exit gracefully, exit code {self.exit_code}.") + log(self.trace_log.decode('UTF-8')) + raise SysCallError(f"'{self.raw_cmd}' did not exit gracefully, exit code {self.exit_code}.\n{self.trace_log.decode('UTF-8')}") self.ended = time.time() with open(f'{self.cwd}/trace.log', 'wb') as fh: -- cgit v1.2.3-54-g00ecf