in src/module_utils/sap_automation_qa.py [0:0]
def handle_error(self, exception: Exception, stderr: str = None):
"""
Handles command execution errors by logging and updating the result dictionary.
:param exception: Exception raised during command execution
:type exception: Exception
:param stderr: Standard error output from the command
:type stderr: str
"""
error_message = f"Error executing command: {exception}."
if stderr:
error_message += f" More errors: {stderr}"
error_message.replace("'", "")
self.log(logging.ERROR, error_message)
self.result["status"] = TestStatus.ERROR.value
self.result["message"] = error_message
self.result["logs"].append(error_message)