-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Implement new QuicException proposal #71432
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
Tagging subscribers to this area: @dotnet/ncl Issue DetailsCloses #70669.
|
...raries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicException.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/ThrowHelper.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/ThrowHelper.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/ThrowHelper.cs
Outdated
Show resolved
Hide resolved
...raries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicException.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3RequestStream.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good modulo comments, thanks!
@@ -1,26 +1,155 @@ | |||
// Licensed to the .NET Foundation under one or more agreements. | |||
// The .NET Foundation licenses this file to you under the MIT license. | |||
|
|||
using Microsoft.Quic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, could you just move the file to System/Net/Quic/Internal so it doesn't wreak complete havoc on my PRs 😄
namespace System.Net.Quic | ||
{ | ||
public class QuicException : Exception | ||
public sealed class QuicException : IOException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need XML comments as well since we generate docs from them.
@@ -877,7 +880,8 @@ public async Task Alpn_NonH3_NegotiationFailure() | |||
}; | |||
|
|||
HttpRequestException ex = await Assert.ThrowsAsync<HttpRequestException>(() => client.SendAsync(request).WaitAsync(TimeSpan.FromSeconds(10))); | |||
Assert.Contains("ALPN_NEG_FAILURE", ex.Message); | |||
AuthenticationException authEx = Assert.IsType<AuthenticationException>(ex.InnerException); | |||
Assert.Contains("Application layer protocol negotiation", authEx.Message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wonder, is it ok to check like that? what if exception message gets localized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know of any other way to check for this specific type of error, so the alternative is to check just for the exception type.
I think I have seen some other test elsewhere that depends on the English localization of the exception messages, but I am not sure where.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked and there is precious few of such cases in runtime sources (e.g. https://github.com/dotnet/runtime/blob/70669-QuicException/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ExceptionTests.cs#L495).
So I will remove the assert
What's the plan about the adaption of |
Good catch, I will put up a follow-up tomorrow |
Closes #70669.