tried to get debugg outputs
This commit is contained in:
parent
b6f03c70c5
commit
3d29277285
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@ from abc import ABC, abstractmethod
|
|||
from typing import Optional, Union
|
||||
from pathlib import Path
|
||||
from os import environ
|
||||
import logging
|
||||
|
||||
# TODO: jem, zam - 2023_04_18: Discuss if we can move more functionality to domain?
|
||||
class FileHandler(ABC):
|
||||
|
@ -185,6 +186,7 @@ class SystemApi():
|
|||
def __init__(self):
|
||||
self.stdout = [""]
|
||||
self.stderr = [""]
|
||||
self.exitcode = 0
|
||||
|
||||
def run(self, args: list[str]):
|
||||
sanitized_args = []
|
||||
|
@ -206,9 +208,14 @@ class SystemApi():
|
|||
else:
|
||||
self.stderr = None
|
||||
|
||||
self.exitcode = stream.returncode
|
||||
|
||||
def run_checked(self, *args):
|
||||
self.run(args)
|
||||
|
||||
logging.warning(f"err: {self.stderr}")
|
||||
logging.warning(f"exit: {self.exitcode}")
|
||||
|
||||
if len(self.stderr) > 0:
|
||||
raise Exception(f"Command failed with: {self.stderr}")
|
||||
|
||||
|
|
Loading…
Reference in a new issue