Title: raise without from discards exception chain in 12 remaining sites · Issue #2564 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: raise without from discards exception chain in 12 remaining sites · Issue #2564 · modelcontextprotocol/python-sdk
X Title: raise without from discards exception chain in 12 remaining sites · Issue #2564 · modelcontextprotocol/python-sdk
Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue Description Follow-up to #2541 (fi...
Open Graph Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ...
X Description: Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening t...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/2564
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"raise without from discards exception chain in 12 remaining sites","articleBody":"### Initial Checks\n\n- [x] I confirm that I'm using the latest version of MCP Python SDK\n- [x] I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this issue\n\n### Description\n\nFollow-up to #2541 (fixed in #2542). The same pattern exists in 12 additional sites across 7 files. Each catches an exception and re-raises a new one without `from`, discarding the original traceback and `__cause__`.\n\n**Sites:**\n\n| File | Line | Caught | Raised |\n|------|------|--------|--------|\n| `client/session.py` | 346 | `ValidationError` | `RuntimeError` |\n| `client/session.py` | 348 | `SchemaError` | `RuntimeError` |\n| `client/auth/utils.py` | 246 | `ValidationError` | `OAuthRegistrationError` |\n| `client/auth/utils.py` | 339 | `ValidationError` | `OAuthTokenError` |\n| `server/auth/middleware/client_auth.py` | 83 | `ValueError`/`UnicodeDecodeError`/`binascii.Error` | `AuthenticationError` |\n| `server/mcpserver/resources/types.py` | 75 | `Exception` | `ValueError` |\n| `server/mcpserver/resources/types.py` | 151 | `Exception` | `ValueError` |\n| `server/mcpserver/resources/types.py` | 196 | `Exception` | `ValueError` |\n| `server/mcpserver/resources/types.py` | 205 | `Exception` | `ValueError` |\n| `server/mcpserver/resources/resource_manager.py` | 96 | `Exception` | `ValueError` |\n| `server/mcpserver/resources/templates.py` | 133 | `Exception` | `ValueError` |\n| `server/mcpserver/prompts/base.py` | 185, 189 | `Exception` | `ValueError` |\n\n### Impact\n\nSame as #2541: without `from`, Python shows \"During handling of the above exception, another exception occurred\" instead of \"The above exception was the direct cause of the following exception.\" Callers cannot inspect `__cause__` to determine the root cause programmatically.\n\nThe codebase already uses `from` correctly in `server.py:451`, `server.py:459`, `server.py:1112`, `func_metadata.py:216,265`, and `tools/base.py:119`. These 12 sites are the remaining inconsistencies.","author":{"url":"https://github.com/blackwell-systems","@type":"Person","name":"blackwell-systems"},"datePublished":"2026-05-08T19:50:46.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2564/python-sdk/issues/2564"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b76a9e46-588c-732f-39b4-65ffb7346230 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D69C:100A0C:5BC560:797493:6A598313 |
| html-safe-nonce | 7ce001f6688ecbaff52a91869c2f5f934f26a8bf4349b269c127c718dafdc11d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjlDOjEwMEEwQzo1QkM1NjA6Nzk3NDkzOjZBNTk4MzEzIiwidmlzaXRvcl9pZCI6IjE4NTY5MzY3NDAwNzE3Njg4NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | be2797e2c25147094397514313f713059ecd34cd50d6cfd7e60b1e3a94a63657 |
| hovercard-subject-tag | issue:4408957973 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/2564/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c60e73d9d687799da82d598326b171c62c0646b57a9d8374fdadf1f5817ddc4/modelcontextprotocol/python-sdk/issues/2564 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c60e73d9d687799da82d598326b171c62c0646b57a9d8374fdadf1f5817ddc4/modelcontextprotocol/python-sdk/issues/2564 |
| og:image:alt | Initial Checks I confirm that I'm using the latest version of MCP Python SDK I confirm that I searched for my issue in https://github.com/modelcontextprotocol/python-sdk/issues before opening this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | blackwell-systems |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 624bb50a7497aa346bef8cc3743af408a9ea10ca |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width