Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion application_sdk/activities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ async def preflight_check(self, workflow_args: Dict[str, Any]) -> Dict[str, Any]
)

if not result or "error" in result:
raise ValueError("Preflight check failed")
raise ValueError(
"Preflight check failed: " + str(result.get("error", ""))
)

logger.info("Preflight check completed successfully")
return result
Expand Down
5 changes: 3 additions & 2 deletions application_sdk/common/aws_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
logger = get_logger(__name__)


def get_region_name_from_hostname(hostname: str) -> str:
def get_region_name_from_hostname(hostname: str) -> str | None:
"""
Extract region name from AWS RDS endpoint.
Example: database-1.abc123xyz.us-east-1.rds.amazonaws.com -> us-east-1
Expand All @@ -28,7 +28,8 @@ def get_region_name_from_hostname(hostname: str) -> str:
match = re.search(r"-([a-z]{2}-[a-z]+-\d)\.", hostname)
if match:
return match.group(1)
raise ValueError("Could not find valid AWS region from hostname")
logger.warning("Could not find valid AWS region from hostname")
return None


def generate_aws_rds_token_with_iam_role(
Expand Down
Loading