mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Updated for error messages
This commit is contained in:
parent
534942b783
commit
faae341112
2 changed files with 3 additions and 4 deletions
|
@ -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. """
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue