tried to get debugg outputs

This commit is contained in:
Michael Jerger 2023-04-21 14:20:03 +02:00
parent b6f03c70c5
commit 3d29277285

View file

@ -5,6 +5,7 @@ from abc import ABC, abstractmethod
from typing import Optional, Union from typing import Optional, Union
from pathlib import Path from pathlib import Path
from os import environ from os import environ
import logging
# TODO: jem, zam - 2023_04_18: Discuss if we can move more functionality to domain? # TODO: jem, zam - 2023_04_18: Discuss if we can move more functionality to domain?
class FileHandler(ABC): class FileHandler(ABC):
@ -185,6 +186,7 @@ class SystemApi():
def __init__(self): def __init__(self):
self.stdout = [""] self.stdout = [""]
self.stderr = [""] self.stderr = [""]
self.exitcode = 0
def run(self, args: list[str]): def run(self, args: list[str]):
sanitized_args = [] sanitized_args = []
@ -206,9 +208,14 @@ class SystemApi():
else: else:
self.stderr = None self.stderr = None
self.exitcode = stream.returncode
def run_checked(self, *args): def run_checked(self, *args):
self.run(args) self.run(args)
logging.warning(f"err: {self.stderr}")
logging.warning(f"exit: {self.exitcode}")
if len(self.stderr) > 0: if len(self.stderr) > 0:
raise Exception(f"Command failed with: {self.stderr}") raise Exception(f"Command failed with: {self.stderr}")