-
Notifications
You must be signed in to change notification settings - Fork 641
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
SWEEP: PrintStackTrace cleanup, #932 #1101
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NightOwl888
requested changes
Jan 14, 2025
src/Lucene.Net.Tests/Index/TestIndexWriterOutOfFileDescriptors.cs
Outdated
Show resolved
Hide resolved
src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestBufferedCharFilter.cs
Outdated
Show resolved
Hide resolved
src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/TestExceptionExtensions.cs
Outdated
Show resolved
Hide resolved
src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/TestExceptionExtensions.cs
Outdated
Show resolved
Hide resolved
src/Lucene.Net.Tests.AllProjects/Support/ExceptionHandling/TestExceptionExtensions.cs
Outdated
Show resolved
Hide resolved
src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
Show resolved
Hide resolved
1 task
FYI, tests failing on .NET FX, I'll get that fixed later today. |
NightOwl888
requested changes
Jan 18, 2025
NightOwl888
approved these changes
Jan 18, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Clean up usages of Exception.StackTrace and consolidate to new PrintStackTrace/PrintCurrentStackTrace methods.
Fixes #932
Description
There were various inconsistent, and sometimes incorrect, translations of
.printStackTrace()
to .NET. This moves the PrintStackTrace extension method into Support, makes it print any Suppressed exceptions, and updates all usages where Lucene usesprintStackTrace
on a caught exception to use this new extension method.In the case where the Lucene code was doing
new Throwable().printStackTrace(...)
to print the stack trace at the call site, this has been replaced with the newStackTraceHelper.PrintCurrentStackTrace(TextWriter)
method. This method skips the frame of itself in the stack trace, and hasNoInlining
set to prevent inlining which could cause the top stack frame to be missed.For suppressed exceptions, it will print them below the string output of the exception if there are any. This PR does not change the structure of suppressed exceptions, i.e. to use AggregateException as discussed in #932, as there didn't seem to be a good seam for doing that at this time.