You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTTP2: Determine how to expose HTTP2 protocol error codes #26932
HTTP2 defines a list of protocol-level errors. Currently there is a Http2ProtocolErrorCode enum that defines these error codes, and Http2ProtocolException that exposes this enum. However, these aren't public currently; they get mapped into a generic HttpRequestException.
We need to determine if and how we want to expose these errors.
This is related to the broader question of how to expose more detailed error information about HTTP failures (is there an issue for this?). We may want to be consistent across HTTP/1.1 and HTTP2 here.
This is related to the broader question of how to expose more detailed error information about HTTP failures (is there an issue for this?). We may want to be consistent across HTTP/1.1 and HTTP2 here.
We have several issues on this topic about adding more detailed, platform-independent, error information.
changed the title [-]HTTP: Determine how to expose HTTP2 protocol error codes[/-][+]HTTP2: Determine how to expose HTTP2 protocol error codes[/+]on Jul 25, 2018
@davidsh, re: dotnet/corefx#31315 (comment), are we on track to do anything about the 1.1 exception error codes / enums for .NET Core 3.0, or is that post-3.0?
At this point, that larger set of issues is post-3.0.
But I think we need to make sure it is an inner exception all the time we throw HttpRequestException for example. We can also derive this exception from Win32Exception instead of Exception. That allows us to put in the integer Http2ProtocolError. We should also make sure that the .Message property of this exception is an informative string.
The key thing here is being able diagnose errors. As long as the inner exception has good information that is sufficient. We don't need to make this exception type a public type.
At this point, that larger set of issues is post-3.0.
Ok, then I'll refrain from making this public now, too, as I'd want the public surface area to all be designed thoughtfully together. For now, I'll do something along the lines of what you suggest.
Activity
davidsh commentedon Jul 24, 2018
We have several issues on this topic about adding more detailed, platform-independent, error information.
#15567
#21447
#911
In particular, the current thought I have is to extended HttpRequestException with a property that is similar to WebException.Status and an enum similar to WebExceptionStatus
[-]HTTP: Determine how to expose HTTP2 protocol error codes[/-][+]HTTP2: Determine how to expose HTTP2 protocol error codes[/+]rmkerr commentedon Jul 31, 2018
I'm actually running into several test failures where the private Http2ProtocolException is thrown without being wrapped in an HttpRequestException.
For example, if I send a frame before the server connection preface:
rmkerr commentedon Jul 31, 2018
In other similar situations I'm seeing an IOException, e.g., when the server closes the stream associated with a request before sending a response:
geoffkizer commentedon Jul 31, 2018
Yeah, there seems to be a missing try/catch to wrap these. We should only be exposing HttpRequestException.
karelz commentedon Apr 25, 2019
@stephentoub we could use help with this one - at least design proposal. Thanks!
stephentoub commentedon Apr 25, 2019
@davidsh, re: https://github.com/dotnet/corefx/issues/31315#issuecomment-407454597, are we on track to do anything about the 1.1 exception error codes / enums for .NET Core 3.0, or is that post-3.0?
davidsh commentedon Apr 25, 2019
At this point, that larger set of issues is post-3.0.
I don't think we need to expose the internal Http2ProtocolException class publicly:
https://github.com/dotnet/corefx/blob/b176a73bdeb9bf3c79b63cee2f13da9a0e0759ab/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs#L1465-#L1466
But I think we need to make sure it is an inner exception all the time we throw HttpRequestException for example. We can also derive this exception from
Win32Exceptioninstead ofException. That allows us to put in the integer Http2ProtocolError. We should also make sure that the .Message property of this exception is an informative string.The key thing here is being able diagnose errors. As long as the inner exception has good information that is sufficient. We don't need to make this exception type a public type.
stephentoub commentedon Apr 25, 2019
Ok, then I'll refrain from making this public now, too, as I'd want the public surface area to all be designed thoughtfully together. For now, I'll do something along the lines of what you suggest.