-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Exception thrown by SocketsHttpHandler has changed #42554
Comments
Tagging subscribers to this area: @dotnet/ncl |
This change got reverted. You should see the old exception behavior here in recent RC2 builds. That said, it would be much better if you didn't have to rely on inner exceptions here. We've talked about having something like HttpRequestErrorCode on HttpRequestMessage; if we had that, presumably there would be a code like HostNotFound and you could check for that. Not sure if we have an issue on this currently... |
You mean like I requested in #15567 5 years ago before, 8 months before .NET Core 1.0 was released? The problem I now have is WCF is still only targeting netstandard2.0. This is because our package is still supported on .NET Framework which stopped at netstandard2.0. I can't access any new api's unless they are exposed in a nuget package which supports netstandard2.0. |
Yep, exactly :) Thanks for finding that issue. |
I've confirmed it's fixed in a more recent build. Closing the issue. |
Description
When a hostname can't be found, WCF throws
System.ServiceModel.EndpointNotFoundException
whenHttpClient.SendAsync
throws a specific exception. The details of the exception have now changed. Previously the exception thrown wasSystem.Net.Http.HttpRequestException
with an inner exception of typeSystem.Net.Sockets.SocketException
. If the value ofSocketException.SocketErrorCode
is one ofSocketError.TryAgain
,SocketError.NoRecovery
,SocketError.NoData
, orSocketError.HostNotFound
, we will throwSystem.ServiceModel.EndpointNotFoundException
.On a recent test run, there's a new exception class between
HttpRequestException
andSocketException
. The exception now looks like this:There is now an additional
NetworkException
in the exception hierarchy.Configuration
.NET Version: .NET 5.0.100-rc.1.20452.10
OS Version: So far I have seen this on OSX and on Windows 10 so this isn't OS specific
Regression?
This is new different behavior in .NET 5 so it is a regression.
The text was updated successfully, but these errors were encountered: