From d209c78b1c6315951b8b435cf7922a2609892cf1 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sat, 20 Jun 2026 15:39:04 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20TIER-2=20READ=20conductor/code=5Fstyle?= =?UTF-8?q?guides/error=5Fhandling.md=20lines=20625-690=20before=20Phase?= =?UTF-8?q?=2012=20=E2=80=94=20Re-Raise=20Patterns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 12: ai_client rethrow classification (6 sites). 3 legitimate re-raise patterns from styleguide: 1. Catch + convert + raise as different type (with rom e): try: json.loads(raw) except json.JSONDecodeError as e: raise ValueError(f'Invalid JSON: {e}') from e 2. Catch + log + re-raise: try: do_something() except Exception as e: logger.exception('failed; will propagate'); raise 3. Catch + cleanup + re-raise (or use try/finally for pure cleanup). SUSPICIOUS pattern (NOT compliant): try: do_something() except Exception: raise This catches an exception, does nothing with it, and re-raises. The try/except is dead code; remove it or use Result-based propagation. Per MUST-DOT-DO #4: 'raise a custom exception class for runtime failures' is forbidden. Migration rules per Phase 12 plan: - If site fits Pattern 1/2/3: leave as-is (audit should classify as COMPLIANT) - If site is SUSPICIOUS (catch + bare raise): MIGRATE to Result[T] - Do NOT classify as 'suspicious' (= sliming) - Per-site: test (if migrated), commit