Updated for error messages

This commit is contained in:
Dimitris Zlatanidis 2023-03-16 22:15:01 +02:00
parent 534942b783
commit faae341112
2 changed files with 3 additions and 4 deletions

View file

@ -341,7 +341,7 @@ class Slackbuilds(Configs):
def print_error(self) -> None: def print_error(self) -> None:
""" Stop the process and print the error message. """ """ Stop the process and print the error message. """
if self.output != 0: 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: def choose_dependencies(self, dependencies: list) -> list:
""" Choose packages for install. """ """ Choose packages for install. """

View file

@ -169,13 +169,12 @@ class Utilities:
with open(file, 'r', encoding='utf-8') as f: with open(file, 'r', encoding='utf-8') as f:
return f.readlines() return f.readlines()
@staticmethod def process(self, command: str, stderr=None, stdout=None):
def process(command, stderr=None, stdout=None):
""" Handle the processes. """ """ Handle the processes. """
try: try:
output = subprocess.call(command, shell=True, stderr=stderr, stdout=stdout) output = subprocess.call(command, shell=True, stderr=stderr, stdout=stdout)
if output != 0: if output != 0:
raise SystemExit(output) self.raise_error_message(str(output))
except KeyboardInterrupt: except KeyboardInterrupt:
raise SystemExit(1) raise SystemExit(1)