paulirwin opened a new pull request, #1101:
URL: https://github.com/apache/lucenenet/pull/1101

   - [X] You've read the [Contributor 
Guide](https://github.com/apache/lucenenet/blob/main/CONTRIBUTING.md) and [Code 
of Conduct](https://www.apache.org/foundation/policies/conduct.html).
   - [X] You've included unit or integration tests for your change, where 
applicable.
   - [X] You've included inline docs for your change, where applicable.
   - [X] There's an open issue for the PR that you are making. If you'd like to 
propose a change, please [open an 
issue](https://github.com/apache/lucenenet/issues/new/choose) to discuss the 
change or find an existing issue.
   
   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 uses `printStackTrace` 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 new 
`StackTraceHelper.PrintCurrentStackTrace(TextWriter)` method. This method skips 
the frame of itself in the stack trace, and has `NoInlining` 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to