Minor exception handling improvement

This commit is contained in:
VakarisZ 2020-10-13 17:45:20 +03:00
parent 24ac497eec
commit 89bdbf946f
1 changed files with 3 additions and 0 deletions

View File

@ -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: