(detail: str)
| 51 | # ── Форматирование деталей ──────────────────────────────────────────────────── |
| 52 | |
| 53 | def 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 | # ── Классификаторы ошибок ───────────────────────────────────────────────────── |
no outgoing calls
no test coverage detected