From ba92c59b7b3d4beac52512ec0b5bbd75504a0e97 Mon Sep 17 00:00:00 2001 From: elmiomar Date: Fri, 21 Jun 2024 11:04:45 -0400 Subject: [PATCH] cleanup --- .../nistoar/pdr/preserv/archive/__init__.py | 46 ------------------- 1 file changed, 46 deletions(-) diff --git a/python/nistoar/pdr/preserv/archive/__init__.py b/python/nistoar/pdr/preserv/archive/__init__.py index 46f911c94..e69de29bb 100644 --- a/python/nistoar/pdr/preserv/archive/__init__.py +++ b/python/nistoar/pdr/preserv/archive/__init__.py @@ -1,46 +0,0 @@ -from .client import SQSArchiveClient, MockArchiveClient - - -def create_client(config): - """Create and return an archive client based on the specified configuration.""" - client_type = config.get("client_type") - if client_type == "sqs": - return SQSArchiveClient(config) - elif client_type == "mock": - return MockArchiveClient() - else: - raise UnsupportedClientTypeException(client_type) - - -class ConfigurationException(Exception): - """ - Exception raised for errors that are related to the application configuration. - - Attributes: - message -- explanation of the error - """ - - def __init__(self, message): - self.message = message - super().__init__(self.message) - - -class UnsupportedClientTypeException(ConfigurationException): - """Exception raised when an unsupported client type is specified.""" - - def __init__(self, client_type, message=None): - if message is None: - message = ( - f"Unsupported client type '{client_type}'. Expected 'sqs' or 'mock'." - ) - super().__init__(message) - - -class SQSException(Exception): - """Custom exception for handling SQS specific errors.""" - - def __init__(self, original_exception, message=None): - self.original_exception = original_exception - if message is None: - message = f"An error occurred with SQS: {str(original_exception)}" - super().__init__(message)