diff --git a/slpkg/slackbuild.py b/slpkg/slackbuild.py index c0544416..03bc39bd 100644 --- a/slpkg/slackbuild.py +++ b/slpkg/slackbuild.py @@ -341,7 +341,7 @@ class Slackbuilds(Configs): def print_error(self) -> None: """ Stop the process and print the error message. """ if self.output != 0: - raise SystemExit(f"\n[{self.bred}FAILED{self.endc}]: {self.output}: {self.process_message}.\n") + self.utils.raise_error_message(f"{self.output}: {self.process_message}") def choose_dependencies(self, dependencies: list) -> list: """ Choose packages for install. """ diff --git a/slpkg/utilities.py b/slpkg/utilities.py index a4fd1ce7..43ce2b5f 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -169,13 +169,12 @@ class Utilities: with open(file, 'r', encoding='utf-8') as f: return f.readlines() - @staticmethod - def process(command, stderr=None, stdout=None): + def process(self, command: str, stderr=None, stdout=None): """ Handle the processes. """ try: output = subprocess.call(command, shell=True, stderr=stderr, stdout=stdout) if output != 0: - raise SystemExit(output) + self.raise_error_message(str(output)) except KeyboardInterrupt: raise SystemExit(1)