Update for exit code

This commit is contained in:
Dimitris Zlatanidis 2024-03-17 21:24:33 +02:00
parent 6b7bcef708
commit 36612c96ad

View file

@ -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. """