diff --git a/monkey/infection_monkey/exploit/mssqlexec.py b/monkey/infection_monkey/exploit/mssqlexec.py index 0b18e824c..220268b76 100644 --- a/monkey/infection_monkey/exploit/mssqlexec.py +++ b/monkey/infection_monkey/exploit/mssqlexec.py @@ -89,10 +89,14 @@ class MSSQLExploiter(HostExploiter): self.remove_temp_dir() except Exception as e: - logger.error( - f"Unhandled exception occurred when trying " + error_message = ( + f"An unexpected error occurred when trying " f"to exploit MSSQL on host {self.host}: {e}" ) + + logger.error(error_message) + self.exploit_result.error_message = error_message + return self.exploit_result self.exploit_result.propagation_success = True