From 36612c96ad01bc22f4b51c3a22cf580e906b524a Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 17 Mar 2024 21:24:33 +0200 Subject: [PATCH] Update for exit code --- slpkg/utilities.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/slpkg/utilities.py b/slpkg/utilities.py index f1714f15..8889bf1e 100644 --- a/slpkg/utilities.py +++ b/slpkg/utilities.py @@ -128,9 +128,10 @@ class Utilities(Configs): raise SystemExit(1) if output.returncode != 0: - message: str = (f"to run command {self.byellow}{command.split()[0]}" - f"{self.endc}: exit code: {output.returncode}") - self.errors.raise_error_message(message, output.returncode) + if command.startswith(('wget', 'wget2', 'curl', 'lftp')): + message: str = f"to run command '{command.split()[0]}' exit code: {output.returncode}" + self.errors.raise_error_message(message, output.returncode) + raise SystemExit(output.returncode) def get_file_size(self, file: Path) -> str: """ Get the local file size and converted to units. """