MCPcopy
hub / github.com/Runnin4ik/dpi-detector / clean_detail

Function clean_detail

utils/error_classifier.py:53–63  ·  view source on GitHub ↗
(detail: str)

Source from the content-addressed store, hash-verified

51# ── Форматирование деталей ────────────────────────────────────────────────────
52
53def clean_detail(detail: str) -> str:
54 import re
55 if not detail or detail in ("OK", "Error"):
56 return ""
57 detail = detail.replace("The operation did not complete", "TLS Aborted")
58 detail = re.sub(r"\s*\(_*\s*$", "", detail)
59 detail = re.sub(r"\s+", " ", detail).strip()
60 detail = detail.replace("Err None: ", "").replace("Conn failed: ", "")
61 if re.match(r"^HTTP [23]\d\d$", detail):
62 return ""
63 return detail.strip()
64
65
66# ── Классификаторы ошибок ─────────────────────────────────────────────────────

Callers 3

build_domain_rowFunction · 0.90
classify_ssl_errorFunction · 0.85
classify_connect_errorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected