From 89bdbf946f580157c209800aa76b4c526d68dcd8 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 13 Oct 2020 17:45:20 +0300 Subject: [PATCH] Minor exception handling improvement --- monkey/infection_monkey/exploit/HostExploiter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monkey/infection_monkey/exploit/HostExploiter.py b/monkey/infection_monkey/exploit/HostExploiter.py index 274d07329..f8fda6d18 100644 --- a/monkey/infection_monkey/exploit/HostExploiter.py +++ b/monkey/infection_monkey/exploit/HostExploiter.py @@ -3,6 +3,7 @@ from abc import abstractmethod from datetime import datetime import infection_monkey.exploit +from common.utils.exceptions import FailedExploitationError from common.utils.exploit_enum import ExploitType from infection_monkey.config import WormConfiguration from infection_monkey.utils.plugins.plugin import Plugin @@ -73,6 +74,8 @@ class HostExploiter(Plugin): result = None try: result = self._exploit_host() + except FailedExploitationError as e: + logger.debug(e) except Exception as _: logger.error(f'Exception in exploit_host', exc_info=True) finally: