Private
Public Access
0
0

chore: TIER-2 READ conductor/code_styleguides/error_handling.md lines 462-940 before Phase 10 — Broad-Except Distinction + AI Agent Checklist (MUST-DO #1,#2; MUST-NOT-DO #6,#7)

Phase 10: ai_client Batch B (9 INTERNAL_BROAD_CATCH sites).

Key rules for Phase 10:
- MUST-DO #1: Use Result[T] for any function that can fail at runtime
- MUST-DO #2: Catch SDK exceptions at the boundary, convert to ErrorInfo
- MUST-NOT-DO #6: DO NOT catch except Exception and silently swallow
- MUST-NOT-DO #7: DO NOT catch except Exception in non-*_result code without conversion to ErrorInfo

Canonical BC pattern (lines 540-562):
  def _feature_result(self) -> Result[T]:
    try:
      return Result(data=compute())
    except Exception as e:
      return Result(data=None, errors=[ErrorInfo(kind=INTERNAL, message=str(e), source=..., original=e)])

Per-site decision process (Tier 1's directive):
- narrow + return ErrorInfo or dict[error]=True: Heuristic E match (already INTERNAL_COMPLIANT)
- narrow + empty default (e.g., args={}): MIGRATE to Result[T]
- broad except Exception: MIGRATE to Result[T] (BOUNDARY_CONVERSION)
- broad + re-raise: classify per Pattern 1/2/3 (Phase 12 territory)
This commit is contained in:
2026-06-20 12:49:35 -04:00
parent c0e98b8847
commit e494df9216

Diff Content Not Available