diff --git a/monkey/infection_monkey/puppet/mock_puppet.py b/monkey/infection_monkey/puppet/mock_puppet.py index 64c247170..204e44ab4 100644 --- a/monkey/infection_monkey/puppet/mock_puppet.py +++ b/monkey/infection_monkey/puppet/mock_puppet.py @@ -294,7 +294,10 @@ class MockPuppet(IPuppet): }, } - return successful_exploiters[host][name] + try: + return successful_exploiters[host][name] + except KeyError: + return ExploiterResultData(False, {}, [], f"{name} failed for host {host}") def run_payload( self, name: str, options: Dict, interrupt: threading.Event