From ce697b3a45b180291fe4620748525c34c9e051f9 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Thu, 25 Feb 2021 16:26:43 +0200 Subject: [PATCH] Improved exception handling of expected exceptions - if they are expected, we don't need to see the error trace. --- monkey/infection_monkey/exploit/HostExploiter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/exploit/HostExploiter.py b/monkey/infection_monkey/exploit/HostExploiter.py index b3bdc7fd8..59d593b09 100644 --- a/monkey/infection_monkey/exploit/HostExploiter.py +++ b/monkey/infection_monkey/exploit/HostExploiter.py @@ -79,8 +79,8 @@ class HostExploiter(Plugin): result = None try: result = self._exploit_host() - except FailedExploitationError: - logger.debug('Exploiter failed.', exc_info=True) + except FailedExploitationError as e: + logger.debug(f'Exploiter failed: {e}.') except Exception: logger.error('Exception in exploit_host', exc_info=True) finally: