Title: RateLimitException HTTP Response Content does not get saved · Issue #2407 · DSharpPlus/DSharpPlus · GitHub
Open Graph Title: RateLimitException HTTP Response Content does not get saved · Issue #2407 · DSharpPlus/DSharpPlus
X Title: RateLimitException HTTP Response Content does not get saved · Issue #2407 · DSharpPlus/DSharpPlus
Description: Summary It seems to be impossible to retrieve the response content of a RateLimitException: catch (RateLimitException ex) { string contents = await ex.Response.Content.ReadAsStringAsync(); // will get stuck indefinitely } as D#+ seems to...
Open Graph Description: Summary It seems to be impossible to retrieve the response content of a RateLimitException: catch (RateLimitException ex) { string contents = await ex.Response.Content.ReadAsStringAsync(); // will ...
X Description: Summary It seems to be impossible to retrieve the response content of a RateLimitException: catch (RateLimitException ex) { string contents = await ex.Response.Content.ReadAsStringAsync(); // will ...
Opengraph URL: https://github.com/DSharpPlus/DSharpPlus/issues/2407
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"RateLimitException HTTP Response Content does not get saved","articleBody":"### Summary\n\nIt seems to be impossible to retrieve the response content of a `RateLimitException`:\n\n```csharp\ncatch (RateLimitException ex)\n{\n string contents = await ex.Response.Content.ReadAsStringAsync(); // will get stuck indefinitely\n}\n```\nas D#+ seems to dispose of it before it gets thrown. This makes it impossible to retrieve important information, such as whether the rate limit is guild-specific or global or the `retry_after` property. \n\nOther exceptions might be affected too, I don't know, I didn't check. \n\n### What version of the library are you using?\n\nv5.0.0-nightly (make sure you are using the latest nightly!)\n\n### What .NET version are you using? Make sure to use the latest patch release for your major version.\n\n.NET 9.0\n\n### Operating System\n\nDocker (Windows 11)\n\n### Reproduction Steps\n\nDo something to cause a `RateLimitException` and try using `.Response.Content.ReadAsStringAsync()`. It will get stuck at that line forever. \n\n### Trace Logs\n\n```log\n\n```\n\n### Exceptions or other error messages\n\n```txt\n\n```\n\n### Anything else you'd like to share\n\nThings like response headers work fine. It just fails for the content. ","author":{"url":"https://github.com/Ascyt","@type":"Person","name":"Ascyt"},"datePublished":"2025-12-27T15:07:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2407/DSharpPlus/issues/2407"}
| 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:8491dafc-3039-8982-08ad-dbbe9ee320ea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A390:22277F:7B64A88:A5F7EB4:698CE230 |
| html-safe-nonce | 02524a3c1ac7a319123f7360c3eb97740345366176087a8738eafa8cf68f98e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzkwOjIyMjc3Rjo3QjY0QTg4OkE1RjdFQjQ6Njk4Q0UyMzAiLCJ2aXNpdG9yX2lkIjoiMjM4OTkwMzk4NjM0Nzc5NDk5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d1a3d1c761d8b7efc3d70911131203521f5ae38282e44b97bc0648542a374a5b |
| hovercard-subject-tag | issue:3764841551 |
| 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/DSharpPlus/DSharpPlus/2407/issue_layout |
| twitter:image | https://opengraph.githubassets.com/00ceee1c7923ae7a54c690593ed7385a01c6ad794bd7671d269446db848975b9/DSharpPlus/DSharpPlus/issues/2407 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/00ceee1c7923ae7a54c690593ed7385a01c6ad794bd7671d269446db848975b9/DSharpPlus/DSharpPlus/issues/2407 |
| og:image:alt | Summary It seems to be impossible to retrieve the response content of a RateLimitException: catch (RateLimitException ex) { string contents = await ex.Response.Content.ReadAsStringAsync(); // will ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Ascyt |
| hostname | github.com |
| expected-hostname | github.com |
| None | 640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/DSharpPlus/DSharpPlus git https://github.com/DSharpPlus/DSharpPlus.git |
| octolytics-dimension-user_id | 36208721 |
| octolytics-dimension-user_login | DSharpPlus |
| octolytics-dimension-repository_id | 67243489 |
| octolytics-dimension-repository_nwo | DSharpPlus/DSharpPlus |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 67243489 |
| octolytics-dimension-repository_network_root_nwo | DSharpPlus/DSharpPlus |
| 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 | 3d444f0a47beeeac94cddbb51c91ab408befe8d4 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width