(exc: Exception, max_depth: int = 10)
| 37 | |
| 38 | |
| 39 | def collect_error_text(exc: Exception, max_depth: int = 10) -> str: |
| 40 | parts = [] |
| 41 | current = exc |
| 42 | for _ in range(max_depth): |
| 43 | parts.append(str(current).lower()) |
| 44 | nxt = current.__cause__ or current.__context__ |
| 45 | if nxt is None: |
| 46 | break |
| 47 | current = nxt |
| 48 | return " | ".join(parts) |
| 49 | |
| 50 | |
| 51 | # ── Форматирование деталей ──────────────────────────────────────────────────── |
no outgoing calls
no test coverage detected