try/catch

This commit is contained in:
Andreas Knuth 2025-11-30 17:13:35 -06:00
parent 9d92a17e76
commit 8011cd5e1d
1 changed files with 7 additions and 3 deletions

View File

@ -34,9 +34,13 @@ SMTP_PASS = os.environ.get('SMTP_PASS')
# Graceful shutdown # Graceful shutdown
shutdown_requested = False shutdown_requested = False
# DynamoDB Ressource (neu im Worker!) # DynamoDB Ressource für Bounce-Lookup
dynamo = boto3.resource('dynamodb', region_name=AWS_REGION) try:
msg_table = dynamo.Table('ses-outbound-messages') dynamo = boto3.resource('dynamodb', region_name=AWS_REGION)
msg_table = dynamo.Table('ses-outbound-messages')
except Exception as e:
log(f"Warning: Could not connect to DynamoDB: {e}", 'WARNING')
msg_table = None
def get_bucket_name(domain): def get_bucket_name(domain):
"""Konvention: domain.tld -> domain-tld-emails""" """Konvention: domain.tld -> domain-tld-emails"""