modelcontextprotocol / modelcontextprotocol/python-sdk
Improve exception tracebacks for easier debugging
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 24.3k
- Forks
- 4k
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 31
Beschreibung
Summary
Make exception tracebacks clearer and easier to understand by reducing asyncio/anyio wrapper noise.
Problem
- Exceptions are often wrapped in multiple layers of asyncio/anyio task group machinery
- Tracebacks are hard to read and don't clearly point to the root cause
- The
raise_exceptionflag is not consistently respected - Errors from deep inside task groups obscure the actual failure point
Goal
- Cleaner tracebacks that point to user code, not SDK internals
- Raise exceptions from the main context where possible
- Reduce nesting of exception wrappers
Related
- #743 - RuntimeError but the actual root cause is not logged correctly
- #396 - MCP Server: Inconsistent Exception Handling in @app.call_tool
- #1401 - ClientSession Error Handling
- #1742 - Introduce typed error classes with metadata
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Im Issue sind keine Dateien oder Tests angegeben. Beginne damit, die asyncio/anyio-Pfade der Task-Gruppen und jede Verwendung des Flags raise_exception nachzuverfolgen, und prüfe anschließend die verknüpften Issues zur Ausnahmebehandlung. Als erledigt gilt die Aufgabe, wenn Tracebacks den Fehler auf Benutzerebene offenlegen, die Verschachtelung von Wrappern reduziert ist und raise_exception konsistent berücksichtigt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- backend-api-design
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100