Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
Added QuicException.TransportErrorCode#88550
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
f2acad7b5c80dc2a98a42f70bd29a41c1ec1772b0dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -67,11 +67,7 @@ internal static unsafe T GetMsQuicParameter<T>(MsQuicSafeHandle handle, uint par | ||
| &length, | ||
| (byte*)&value); | ||
| if (StatusFailed(status)) | ||
| { | ||
| throw ThrowHelper.GetExceptionForMsQuicStatus(status, $"GetParam({handle}, {parameter}) failed"); | ||
| } | ||
| ThrowHelper.ThrowIfMsQuicError(status, $"GetParam({handle}, {parameter}) failed"); | ||
| return value; | ||
| } | ||
| @@ -84,9 +80,6 @@ internal static unsafe void SetMsQuicParameter<T>(MsQuicSafeHandle handle, uint | ||
| (uint)sizeof(T), | ||
| (byte*)&value); | ||
| if (StatusFailed(status)) | ||
| { | ||
| throw ThrowHelper.GetExceptionForMsQuicStatus(status, $"SetParam({handle}, {parameter}) failed"); | ||
| } | ||
| ThrowHelper.ThrowIfMsQuicError(status, $"SetParam({handle}, {parameter}) failed"); | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is now going to allocate a string for the error message even in the success case. | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -17,7 +17,18 @@ public sealed class QuicException : IOException | ||
| /// <param name="applicationErrorCode">The application protocol error code associated with the error.</param> | ||
| /// <param name="message">The message for the exception.</param> | ||
| public QuicException(QuicError error, long? applicationErrorCode, string message) | ||
| : this(error, applicationErrorCode, message, null) | ||
| : this(error, applicationErrorCode, null, message, null) | ||
| { } | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref='QuicException'/> class. | ||
| /// </summary> | ||
| /// <param name="error">The error associated with the exception.</param> | ||
| /// <param name="applicationErrorCode">The application protocol error code associated with the error.</param> | ||
| /// <param name="transportErrorCode">The transport protocol error code associated with the error.</param> | ||
| /// <param name="message">The message for the exception.</param> | ||
| internal QuicException(QuicError error, long? applicationErrorCode, long? transportErrorCode, string message) | ||
| : this(error, applicationErrorCode, transportErrorCode, message, null) | ||
| { } | ||
| /// <summary> | ||
| @@ -28,10 +39,23 @@ public QuicException(QuicError error, long? applicationErrorCode, string message | ||
| /// <param name="message">The message for the exception.</param> | ||
| /// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param> | ||
| internal QuicException(QuicError error, long? applicationErrorCode, string message, Exception? innerException) | ||
| : this(error, applicationErrorCode, null, message, innerException) | ||
| { } | ||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref='QuicException'/> class. | ||
| /// </summary> | ||
| /// <param name="error">The error associated with the exception.</param> | ||
| /// <param name="applicationErrorCode">The application protocol error code associated with the error.</param> | ||
| /// <param name="transportErrorCode">The transport protocol error code associated with the error.</param> | ||
| /// <param name="message">The message for the exception.</param> | ||
| /// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param> | ||
| internal QuicException(QuicError error, long? applicationErrorCode, long? transportErrorCode, string message, Exception? innerException) | ||
AlexRadch marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| : base(message, innerException) | ||
| { | ||
| QuicError = error; | ||
| ApplicationErrorCode = applicationErrorCode; | ||
| TransportErrorCode = transportErrorCode; | ||
| } | ||
| /// <summary> | ||
| @@ -46,4 +70,9 @@ internal QuicException(QuicError error, long? applicationErrorCode, string messa | ||
| /// This property contains the error code set by the application layer when closing the connection (<see cref="QuicError.ConnectionAborted"/>) or closing a read/write direction of a QUIC stream (<see cref="QuicError.StreamAborted"/>). Contains null for all other errors. | ||
| /// </remarks> | ||
| public long? ApplicationErrorCode { get; } | ||
| /// <summary> | ||
| /// The transport protocol error code associated with the error. | ||
| /// </summary> | ||
| public long? TransportErrorCode { get; } | ||
| } | ||
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 is now going to allocate a string for the error message even in the success case.
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'm going to address this in some of my future PRs. Or @wfurt do you think you could revert these two in #88614?
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 think it is ok in interim as it is only perf optimization. I feel it is more important to get the API out.