From 94524d124c2d23fb243496adb275bcce46c5a1b4 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 24 Jun 2022 13:01:56 -0400 Subject: [PATCH] Common: Add InvalidConfigurationError --- monkey/common/configuration/__init__.py | 4 +--- monkey/common/configuration/agent_configuration.py | 4 ++++ monkey/common/utils/exceptions.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/monkey/common/configuration/__init__.py b/monkey/common/configuration/__init__.py index 1505f0e68..06ce30b50 100644 --- a/monkey/common/configuration/__init__.py +++ b/monkey/common/configuration/__init__.py @@ -1,6 +1,4 @@ -from .agent_configuration import ( - AgentConfiguration, -) +from .agent_configuration import AgentConfiguration, InvalidConfigurationError from .agent_sub_configurations import ( CustomPBAConfiguration, PluginConfiguration, diff --git a/monkey/common/configuration/agent_configuration.py b/monkey/common/configuration/agent_configuration.py index 71c4bfd49..fe42e303d 100644 --- a/monkey/common/configuration/agent_configuration.py +++ b/monkey/common/configuration/agent_configuration.py @@ -17,6 +17,10 @@ from .agent_sub_configurations import ( ) +class InvalidConfigurationError(Exception): + pass + + @dataclass(frozen=True) class AgentConfiguration: keep_tunnel_open_time: float diff --git a/monkey/common/utils/exceptions.py b/monkey/common/utils/exceptions.py index 5935145e7..31cebca32 100644 --- a/monkey/common/utils/exceptions.py +++ b/monkey/common/utils/exceptions.py @@ -38,5 +38,7 @@ class DomainControllerNameFetchError(FailedExploitationError): """Raise on failed attempt to extract domain controller's name""" +# TODO: This has been replaced by common.configuration.InvalidConfigurationError. Use that error +# instead and remove this one. class InvalidConfigurationError(Exception): """Raise when configuration is invalid"""