Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always include the original exception in HttpClient #84717

Merged
merged 2 commits into from
Apr 13, 2023

Conversation

MihaZupan
Copy link
Member

Fixes #84712

@MihaZupan MihaZupan added this to the 8.0.0 milestone Apr 12, 2023
@MihaZupan MihaZupan self-assigned this Apr 12, 2023
@ghost
Copy link

ghost commented Apr 12, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #84712

Author: MihaZupan
Assignees: MihaZupan
Labels:

area-System.Net.Http

Milestone: 8.0.0

@MihaZupan MihaZupan requested a review from a team April 12, 2023 22:13
@MihaZupan
Copy link
Member Author

Example difference:

System.OperationCanceledException: The operation was canceled.
    at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
    at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
System.Threading.Tasks.TaskCanceledException: The operation was canceled.
     ---> System.Net.Http.HttpRequestException: Useful information
     ---> System.Exception: Useful inner exception information
       --- End of inner exception stack trace ---
       at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>g__InterestingMethodInTheStackTrace|6_1(Func`1 exceptionFactory)
       at System.Net.Http.Functional.Tests.HttpClientTest.HttpClientSendTest.<>c__DisplayClass6_0.<<Send_InnerHandlerThrows_OriginalExceptionInformationIsCaptured>b__0>d.MoveNext()
    --- End of stack trace from previous location ---
       at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
       --- End of inner exception stack trace ---
       at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
       at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)

@MihaZupan
Copy link
Member Author

Test failure is #84257

@MihaZupan MihaZupan merged commit 18e9c66 into dotnet:main Apr 13, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HttpClient is eating useful exception information
3 participants