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:
|
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. """
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue