Skip to content

Commit 9cd20f1

Browse files
committed
fix: upgrade LE expansion failure to WARNING, include exception in parameter warning
- _detect_foreach_code_changes: upgrade from debug to warning level so users see when ForEach code change detection is skipped - _resolve_nested_stack_parameters: include exception message in the warning so users can diagnose without --debug
1 parent 9b1b5f5 commit 9cd20f1

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

samcli/lib/package/artifact_exporter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ def _resolve_nested_stack_parameters(nested_params: Dict, parent_parameter_value
9898
# Expected: the nested-stack parameter references something the
9999
# resolver can't see at package time (e.g. a sibling resource).
100100
continue
101-
except Exception: # pylint: disable=broad-except
101+
except Exception as e: # pylint: disable=broad-except
102102
# Unexpected — likely a SAM CLI bug. Log with traceback so
103103
# --debug surfaces it; drop the value so packaging still proceeds.
104104
LOG.warning(
105-
"Unexpected error resolving nested stack parameter %r; skipping. " "Run with --debug for details.",
105+
"Unexpected error resolving nested stack parameter %r; skipping: %s. "
106+
"Run with --debug for the full traceback.",
106107
name,
108+
e,
107109
)
108110
LOG.debug("Traceback for parameter %r resolution failure:", name, exc_info=True)
109111
continue

samcli/lib/sync/infra_sync_executor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,12 @@ def _detect_foreach_code_changes(
589589
current_expanded = expand_language_extensions(current_template).expanded_template
590590
deployed_expanded = expand_language_extensions(last_deployed_template).expanded_template
591591
except Exception:
592-
LOG.debug("Failed to expand language extensions for code change detection, skipping", exc_info=True)
592+
LOG.warning(
593+
"Failed to expand language extensions for code change detection. "
594+
"ForEach-generated resources will not be checked for code changes. "
595+
"Run with --debug for details."
596+
)
597+
LOG.debug("Language extension expansion failure details:", exc_info=True)
593598
return
594599

595600
current_resources = current_expanded.get("Resources", {})

0 commit comments

Comments
 (0)