From 54f5a06c2f47bdf000f7bde956487cd827c02a66 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Thu, 21 May 2026 11:45:28 +0200 Subject: [PATCH] =?UTF-8?q?fix(audit):=20P90-Diagnose=20=E2=80=94=20verbos?= =?UTF-8?q?e=20Exception=20fuer=20fetch+auto-discovery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BMW-Lauf 760de886 hat 0 cmp_payloads obwohl consent-tester ePaaS 4x captured. Backend-Log zeigt 'Consent-tester fetch failed for ...anbieterkennzeichnung.html: ' mit LEEREM Exception-String. Auch 'auto-discovery failed for https://www.bmw.de/: ' ist leer. Quick-Fix: str(e) + type(e).__name__ in beiden Except-Bloecken, damit naechster BMW-Lauf den echten Fehler sichtbar macht. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../compliance/api/agent_compliance_check_routes.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend-compliance/compliance/api/agent_compliance_check_routes.py b/backend-compliance/compliance/api/agent_compliance_check_routes.py index 1fae9297..7d968edb 100644 --- a/backend-compliance/compliance/api/agent_compliance_check_routes.py +++ b/backend-compliance/compliance/api/agent_compliance_check_routes.py @@ -1271,7 +1271,9 @@ async def _fetch_text(url: str, doc_type: str = "") -> tuple[str, list[dict]]: fallback_text = merged or cmp_cookie_text or "" return fallback_text, cmp_payloads except Exception as e: - logger.warning("Consent-tester fetch failed for %s: %s", url, e) + # P90: verbose exception fuer Diagnose (war vorher empty) + logger.warning("Consent-tester fetch failed for %s: %s (%s)", + url, str(e) or "(empty)", type(e).__name__) # 2. Fallback: direct HTTP fetch (works for SSR pages like BMW). # P7: kenntlicher UA + per-Domain Rate-Limit. @@ -1416,7 +1418,9 @@ async def _autodiscover_missing( len(body.get("cmp_payloads") or []), len(cmp_text.split())) except Exception as e: - logger.warning("auto-discovery failed for %s: %s", base, e) + # P90: verbose exception fuer Diagnose + logger.warning("auto-discovery failed for %s: %s (%s)", + base, str(e) or "(empty)", type(e).__name__) # Classify each discovered doc into a canonical doc_type by_type: dict[str, dict] = {}