Title: Exceptions are not propagated properly · Issue #2 · RandomOrg/JSON-RPC-.NET · GitHub
Open Graph Title: Exceptions are not propagated properly · Issue #2 · RandomOrg/JSON-RPC-.NET
X Title: Exceptions are not propagated properly · Issue #2 · RandomOrg/JSON-RPC-.NET
Description: If RandomOrgClient roc = RandomOrgClient.GetRandomOrgClient(YOUR_API_KEY_HERE); is executed without an active internet connection, the resulting exception is not handled by the surrounding try/catch block. Execution always stops here: In...
Open Graph Description: If RandomOrgClient roc = RandomOrgClient.GetRandomOrgClient(YOUR_API_KEY_HERE); is executed without an active internet connection, the resulting exception is not handled by the surrounding try/catc...
X Description: If RandomOrgClient roc = RandomOrgClient.GetRandomOrgClient(YOUR_API_KEY_HERE); is executed without an active internet connection, the resulting exception is not handled by the surrounding try/catc...
Opengraph URL: https://github.com/RandomOrg/JSON-RPC-.NET/issues/2
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Exceptions are not propagated properly","articleBody":"If RandomOrgClient roc = RandomOrgClient.GetRandomOrgClient(YOUR_API_KEY_HERE); is executed without an active internet connection, the resulting exception **is not handled** by the surrounding try/catch block.\n\nExecution always stops here:\n\u003cimg width=\"2142\" height=\"1280\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/8d531535-3bc0-4fb7-9daa-2a7e3acadb06\" /\u003e\n\nInstead of getting to the catch clause of my try/catch block:\n\n```\n try\n\t {\n var client = RandomOrgClient.GetRandomOrgClient(RANDOM_ORG_KEY);\n var randomNumbers = client.GenerateIntegers(10, 1, 10, true);\n\t }\n\t catch (Exception ex)\n\t {\n\t \t// IT NEVER GETS HERE\n\t }\n\n```\n\nIn other words, exceptions triggered inside ThreadedRequestSending (the \"core\" part of the library) are not propagated back to the caller and they just make the applications crash.\n\nHow to reproduce:\n1) Implement a simple console application containing the code above\n2) Run it WITHOUT being connected to the Internet or just throw an exception from ThreadedRequestSending\n\nThe issue is likely caused by the fact that requested are sent in separate threads (ThreadedRequestSending), but this approach prevents proper handling of exceptions raised by the library. If that is the actual reason for this behaviour, I would suggest to use one of the following approaches to propagate the error back to the caller:\n\n- Ashared data structure (e.g., ConcurrentQueue\u003cException\u003e).\n- Events or callbacks.\n- **Switch to Task and async/await for easier exception propagation.**","author":{"url":"https://github.com/nandaccio","@type":"Person","name":"nandaccio"},"datePublished":"2025-08-22T11:05:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2/JSON-RPC-.NET/issues/2"}
| 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:a7596dc6-d4ed-ffb9-6db7-dbfc26e88741 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB2C:7A2FF:4F029:6D2DE:6981E908 |
| html-safe-nonce | a0c8549578c0ca54da395f16a3d0f656f2d294cf5735654bd537a7e503c9617b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjJDOjdBMkZGOjRGMDI5OjZEMkRFOjY5ODFFOTA4IiwidmlzaXRvcl9pZCI6IjU1MzI1OTM3NDc5NTY3MjE5MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | df9b60ea166e7a0d163bc2a3ee8e65c25ad7a9d67e95b59e99ab44e315a2a56d |
| hovercard-subject-tag | issue:3345097234 |
| 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/RandomOrg/JSON-RPC-.NET/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/14a3b3362635707321a542275b8c2f0f66115c1129ac7b52f0da872e5cdfc3ea/RandomOrg/JSON-RPC-.NET/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/14a3b3362635707321a542275b8c2f0f66115c1129ac7b52f0da872e5cdfc3ea/RandomOrg/JSON-RPC-.NET/issues/2 |
| og:image:alt | If RandomOrgClient roc = RandomOrgClient.GetRandomOrgClient(YOUR_API_KEY_HERE); is executed without an active internet connection, the resulting exception is not handled by the surrounding try/catc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nandaccio |
| hostname | github.com |
| expected-hostname | github.com |
| None | ebfdf8d3e0fd17b103f41cc6696d84938694ebebdfecaf11fe00dbe4a9785801 |
| turbo-cache-control | no-preview |
| go-import | github.com/RandomOrg/JSON-RPC-.NET git https://github.com/RandomOrg/JSON-RPC-.NET.git |
| octolytics-dimension-user_id | 3757089 |
| octolytics-dimension-user_login | RandomOrg |
| octolytics-dimension-repository_id | 394353906 |
| octolytics-dimension-repository_nwo | RandomOrg/JSON-RPC-.NET |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 394353906 |
| octolytics-dimension-repository_network_root_nwo | RandomOrg/JSON-RPC-.NET |
| 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 | 471ae8701b77c1bf177c58019d2e6fd65ae89141 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width