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

Implement new QuicException proposal #71432

Merged
merged 16 commits into from
Jul 12, 2022
Merged

Conversation

rzikm
Copy link
Member

@rzikm rzikm commented Jun 29, 2022

Closes #70669.

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

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.

@ghost ghost assigned rzikm Jun 29, 2022
@rzikm rzikm marked this pull request as draft June 29, 2022 13:58
@ghost
Copy link

ghost commented Jun 29, 2022

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

Issue Details

Closes #70669.

Author: rzikm
Assignees: -
Labels:

new-api-needs-documentation, area-System.Net.Quic

Milestone: -

@rzikm rzikm marked this pull request as ready for review July 12, 2022 18:51
Copy link
Member

@ManickaP ManickaP left a 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!
:shipit:

@@ -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;
Copy link
Member

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
Copy link
Member

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);
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antonfirsov
Copy link
Member

antonfirsov commented Jul 12, 2022

What's the plan about the adaption of HttpProtocolException? Wasn't the goal to add it in this PR?

@rzikm rzikm merged commit aa156db into dotnet:main Jul 12, 2022
@rzikm
Copy link
Member Author

rzikm commented Jul 12, 2022

What's the plan about the adaption of HttpProtocolException? Wasn't the goal to add it in this PR?

Good catch, I will put up a follow-up tomorrow

@karelz karelz added this to the 7.0.0 milestone Jul 19, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 18, 2022
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.

[API Proposal]: [QUIC] QuicException
8 participants