docs(P07): complete swallowed-error-hardening phase (v1.13.10)

---ci---
project: acdl
phase: 7
milestone: v1.14
status: complete
requirements:
  covered: [REQ-141]
  partial: []
---/ci---
This commit is contained in:
Jon Chery
2026-07-29 20:43:08 +00:00
parent 69d8496107
commit 225de0f613
5 changed files with 34 additions and 13 deletions
+11 -1
View File
@@ -17,6 +17,7 @@ requests. The invoke policy is scoped via ABAC (consumer repo identity).
import datetime
import json
import os
import urllib.error
import urllib.parse
import boto3
@@ -154,7 +155,16 @@ def _report_error(payload):
with urllib.request.urlopen(req, timeout=10) as resp:
search_result = json.loads(resp.read())
existing = search_result.get("items", [])
except Exception:
except urllib.error.HTTPError as e:
if e.code == 404:
existing = []
else:
import sys
print(f"WARNING: GitHub issue search failed (HTTP {e.code}): {e}", file=sys.stderr)
existing = []
except urllib.error.URLError as e:
import sys
print(f"WARNING: GitHub issue search network error: {e}", file=sys.stderr)
existing = []
body = f"""## Deploy Failure Report
+3 -2
View File
@@ -371,8 +371,9 @@ class LocalLambdaStub:
return _FakeResponse(
json.dumps([{"number": 1, "title": "stub"}]).encode())
urllib.request.urlopen = _fake_urlopen
except Exception:
pass
except (AttributeError, TypeError) as e:
import sys
print(f"WARNING: could not patch urlopen for local Lambda stub: {e}", file=sys.stderr)
try:
event = {
+7 -3
View File
@@ -97,8 +97,10 @@ def publish_to_ssm(outputs, environment, contract_id):
Overwrite=True,
)
results[name] = param_name
except Exception:
# Don't fail the pipeline if one output fails to publish
except Exception as e:
# Don't fail the pipeline if one output fails to publish, but log it
import sys
print(f"WARNING: SSM put_parameter failed for {name}: {e}", file=sys.stderr)
results[name] = None
return results
@@ -165,7 +167,9 @@ def post_github_comment(comment_text, token=None, repo=None, pr_number=None):
req.add_header("Accept", "application/vnd.github+json")
urllib.request.urlopen(req, timeout=10)
return True
except Exception:
except Exception as e:
import sys
print(f"WARNING: GitHub PR comment failed: {e}", file=sys.stderr)
return False