diff --git a/src/cloudformation_cli_python_lib/exceptions.py b/src/cloudformation_cli_python_lib/exceptions.py index 137724e5..e891f84e 100644 --- a/src/cloudformation_cli_python_lib/exceptions.py +++ b/src/cloudformation_cli_python_lib/exceptions.py @@ -96,6 +96,14 @@ def __init__(self, type_name: str, message: str): ) +class UnsupportedTarget(_HandlerError): + def __init__(self, hook_type_name: str, target_type_name: str): + super().__init__( + f"Hook of type '{hook_type_name}' received request" + f" for unsupported target '{target_type_name}'" + ) + + class Unknown(_HandlerError): pass diff --git a/src/cloudformation_cli_python_lib/interface.py b/src/cloudformation_cli_python_lib/interface.py index 51c65515..6a270539 100644 --- a/src/cloudformation_cli_python_lib/interface.py +++ b/src/cloudformation_cli_python_lib/interface.py @@ -73,6 +73,7 @@ class HandlerErrorCode(str, _AutoName): InvalidTypeConfiguration = auto() HandlerInternalFailure = auto() NonCompliant = auto() + UnsupportedTarget = auto() Unknown = auto()