Skip to content

Commit

Permalink
refactor config exception logic
Browse files Browse the repository at this point in the history
  • Loading branch information
elmiomar committed Jun 12, 2024
1 parent f6b285a commit ecdaed4
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions python/nistoar/pdr/preserv/archive/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,12 @@ def __init__(self, config, validator):
f"Missing required configuration keys: {', '.join(missing_keys)}"
)

try:
self.sqs = boto3.client(
"sqs",
region_name=config["region"],
aws_access_key_id=config["aws_access_key_id"],
aws_secret_access_key=config["aws_secret_access_key"],
)
except Exception as e:
raise ConfigurationException(f"Error initializing AWS SQS client: {e}")

self.sqs = boto3.client(
"sqs",
region_name=config["region"],
aws_access_key_id=config["aws_access_key_id"],
aws_secret_access_key=config["aws_secret_access_key"],
)
self.request_queue_url = config["request_queue_url"]
self.completion_queue_url = config["completion_queue_url"]
self.validator = validator
Expand Down

0 comments on commit ecdaed4

Please sign in to comment.