Surface root cause in ErrorMessage for wrapped exceptions#2352
Merged
alexeyzimarev merged 2 commits intodevfrom Feb 26, 2026
Merged
Surface root cause in ErrorMessage for wrapped exceptions#2352alexeyzimarev merged 2 commits intodevfrom
alexeyzimarev merged 2 commits intodevfrom
Conversation
…e errors
When HttpClient wraps errors (e.g. TLS/SSL failures), the outer exception
message is generic ("An error occurred while sending the request"). Using
GetBaseException().Message surfaces the actual root cause, making diagnostics
much easier. The full exception chain remains preserved in ErrorException.
Fixes #2278
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Review Summary by QodoSurface root cause in ErrorMessage for wrapped exceptions
WalkthroughsDescription• Surface root cause exception message instead of generic wrapper • Use GetBaseException().Message for ErrorMessage in error handling • Preserve full exception chain in ErrorException property • Improves diagnostics for TLS/SSL and other wrapped exceptions Diagramflowchart LR
A["Exception with wrapper message"] -->|GetBaseException| B["Root cause exception"]
B -->|Extract Message| C["Specific error details"]
A -->|Preserve chain| D["ErrorException property"]
C --> E["ErrorMessage property"]
File Changes1. src/RestSharp/Response/RestResponseBase.cs
|
Contributor
Code Review by Qodo
1. Inconsistent timeout classification
|
Deploying restsharp with
|
| Latest commit: |
5b1de23
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c1556ef6.restsharp.pages.dev |
| Branch Preview URL: | https://fix-innermost-error-message.restsharp.pages.dev |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Test Results 42 files 42 suites 17m 49s ⏱️ Results for commit 5b1de23. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
exception.GetBaseException().Messageinstead ofexception.MessageforErrorMessagein bothGetErrorResponseandAddExceptionErrorExceptionFixes #2278
Test plan
ErrorMessagestring contentErrorMessageErrorExceptionstill contains the full exception chain🤖 Generated with Claude Code