-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Convert connection lost exceptions to cancellations to avoid overreporting NFE #61792
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,14 @@ | |
|
|
||
| namespace Microsoft.CodeAnalysis.ErrorReporting | ||
| { | ||
| internal sealed class OperationCanceledNotMachingCancellationTokenException : OperationCanceledException | ||
| { | ||
| public OperationCanceledNotMachingCancellationTokenException(Exception innerException) | ||
| : base(innerException.Message, innerException) | ||
| { | ||
| } | ||
| } | ||
|
|
||
| internal static class FatalError | ||
| { | ||
| public delegate void ErrorReporterHandler(Exception exception, ErrorSeverity severity, bool forceDump); | ||
|
|
@@ -124,7 +132,7 @@ public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSe | |
| [DebuggerHidden] | ||
| public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) | ||
| { | ||
| if (ExceptionUtilities.IsCurrentOperationBeingCancelled(exception, contextCancellationToken)) | ||
| if (ExceptionUtilities.IsCurrentOperationBeingCancelled(exception, contextCancellationToken) || exception is OperationCanceledNotMachingCancellationTokenException) | ||
|
||
| { | ||
| return false; | ||
| } | ||
|
|
@@ -200,7 +208,7 @@ public static bool ReportAndCatchUnlessCanceled(Exception exception, ErrorSeveri | |
| [DebuggerHidden] | ||
| public static bool ReportAndCatchUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity = ErrorSeverity.Uncategorized) | ||
| { | ||
| if (ExceptionUtilities.IsCurrentOperationBeingCancelled(exception, contextCancellationToken)) | ||
| if (ExceptionUtilities.IsCurrentOperationBeingCancelled(exception, contextCancellationToken) || exception is OperationCanceledNotMachingCancellationTokenException) | ||
| { | ||
| return false; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.