This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit fe3128c051cccd7c2d548cb99db13cb5cb4279ce
Author: Shad Storhaug <[email protected]>
AuthorDate: Sat Aug 14 09:34:23 2021 +0700

    Lucene.Net.Tests.Index.TestAddIndexes: Updated error handling to use our 
extension methods and use printStackTrace() to log errors
---
 src/Lucene.Net.Tests/Index/TestAddIndexes.cs | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Lucene.Net.Tests/Index/TestAddIndexes.cs 
b/src/Lucene.Net.Tests/Index/TestAddIndexes.cs
index b37f10a..2c4f345 100644
--- a/src/Lucene.Net.Tests/Index/TestAddIndexes.cs
+++ b/src/Lucene.Net.Tests/Index/TestAddIndexes.cs
@@ -755,7 +755,7 @@ namespace Lucene.Net.Index
 
             internal override void Handle(Exception t)
             {
-                Console.Error.WriteLine(t.StackTrace);
+                t.printStackTrace(Console.Out);
                 lock (failures)
                 {
                     failures.Add(t);
@@ -853,9 +853,9 @@ namespace Lucene.Net.Index
 
             internal override void Handle(Exception t)
             {
-                if (!(t is ObjectDisposedException) && !(t is 
NullReferenceException))
+                if (!t.IsAlreadyClosedException() && !(t is 
NullReferenceException))
                 {
-                    Console.Error.WriteLine(t.StackTrace);
+                    t.printStackTrace(Console.Out);
                     lock (failures)
                     {
                         failures.Add(t);
@@ -942,7 +942,7 @@ namespace Lucene.Net.Index
             {
                 bool report = true;
 
-                if (t is ObjectDisposedException || t is 
MergePolicy.MergeAbortedException || t is NullReferenceException)
+                if (t.IsAlreadyClosedException() || t is 
MergePolicy.MergeAbortedException || t is NullReferenceException)
                 {
                     report = !didClose;
                 }
@@ -950,7 +950,7 @@ namespace Lucene.Net.Index
                 {
                     report = !didClose;
                 }
-                else if (t is IOException)
+                else if (t.IsIOException())
                 {
                     Exception t2 = t.InnerException;
                     if (t2 is MergePolicy.MergeAbortedException)
@@ -960,7 +960,7 @@ namespace Lucene.Net.Index
                 }
                 if (report)
                 {
-                    Console.Out.WriteLine(t.StackTrace);
+                    t.printStackTrace(Console.Out);
                     lock (failures)
                     {
                         failures.Add(t);

Reply via email to