-
Notifications
You must be signed in to change notification settings - Fork 4.2k
More fault handling cleanup #59097
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
base: main
Are you sure you want to change the base?
More fault handling cleanup #59097
Conversation
a958bba
to
8197c61
Compare
8197c61
to
275c552
Compare
/// <returns><see langword="false"/> to avoid catching the exception.</returns> | ||
[DebuggerHidden] | ||
public static bool ReportAndPropagateUnlessCanceled(Exception exception, CancellationToken contextCancellationToken, ErrorSeverity severity) | ||
public static bool ReportAndPropagateUnlessCanceled(Exception exception, ErrorSeverity severity, CancellationToken contextCancellationToken) |
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.
Did 'Change Signature' make this easy?
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.
It did! Although sometimes it did nothing at all, and my effort to debug that kept resulting in the debugger breaking. 😄
d196377
to
e609476
Compare
This comment was marked as outdated.
This comment was marked as outdated.
e609476
to
5827aea
Compare
Everything has to be categorized from now on.
Otherwise these are using the "regular" error reporting which will send non-fatal events.
5827aea
to
0b5e47b
Compare
Could you please elaborate on how severities were chosen in general? |
@RikkiGibson Oh, forgot to update the PR for that. PR description updated now. |
Visit(m); | ||
} | ||
catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e)) | ||
catch (Exception e) when (FatalError.ReportAndPropagateUnlessCanceled(e, ErrorSeverity.General)) |
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.
ErrorSeverity.General should be the default. This coding pattern is unnecessarily burdensome.
Commit-by-commit recommended. For the addition of severities, they were chosen based on the rough criteria described for each option:
roslyn/src/Compilers/Core/Portable/InternalUtilities/FatalError.cs
Lines 260 to 286 in 0b5e47b