Skip to content

Commit e91997d

Browse files
committed
Capture error response body for AWS 401; quote pip extras
1 parent 2ec6b12 commit e91997d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/drift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
python-version: "3.12"
2525

2626
- name: Install Terradev CLI
27-
run: pip install .[aws,gcp]
27+
run: pip install ".[aws,gcp]"
2828

2929
- name: Run canary drift checks
3030
env:

terradev_cli/drift_monitor/agent.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@ def _check_endpoint(
266266
result["drift_reasons"].append(
267267
f"expected HTTP {expected_status}, got {response.status_code}"
268268
)
269+
# Include a short snapshot of the response body to diagnose auth failures.
270+
try:
271+
err_text = response.text.strip()[:500]
272+
if err_text:
273+
result["error_body"] = err_text
274+
except (ValueError, TypeError, AttributeError):
275+
pass
269276
result["drift_summary"] = "; ".join(result["drift_reasons"])
270277
return result
271278

0 commit comments

Comments
 (0)