From 0e9397b283de24b9a97b94cab0cfbef55577cf2b Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Tue, 20 Sep 2022 18:30:21 +0530 Subject: [PATCH] Agent: Add RetrievalError to i_agent_binary_repository.py --- .../infection_monkey/exploit/i_agent_binary_repository.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/monkey/infection_monkey/exploit/i_agent_binary_repository.py b/monkey/infection_monkey/exploit/i_agent_binary_repository.py index 09de7a696..b78888864 100644 --- a/monkey/infection_monkey/exploit/i_agent_binary_repository.py +++ b/monkey/infection_monkey/exploit/i_agent_binary_repository.py @@ -7,6 +7,12 @@ from common import OperatingSystem # moment, the Island and Agent have different needs, but at some point we should unify these. +class RetrievalError(RuntimeError): + """ + Raised when a repository encounters an error while attempting to retrieve data + """ + + class IAgentBinaryRepository(metaclass=abc.ABCMeta): """ IAgentBinaryRepository provides an interface for other components to access agent binaries. @@ -23,5 +29,6 @@ class IAgentBinaryRepository(metaclass=abc.ABCMeta): :param operating_system: The name of the operating system on which the agent binary will run :param architecture: Reserved :return: A file-like object for the requested agent binary + :raises RetrievalError: If an error occurs when retrieving the agent binary """ pass