lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1165376 - /incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/ParallelMultiSearcher.cs
Date Mon, 05 Sep 2011 18:29:32 GMT
Author: digy
Date: Mon Sep  5 18:29:31 2011
New Revision: 1165376

URL: http://svn.apache.org/viewvc?rev=1165376&view=rev
Log:
[LUCENENET-442] ParallelMultiSearcher threads don't handle all exceptions

Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/ParallelMultiSearcher.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/ParallelMultiSearcher.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/ParallelMultiSearcher.cs?rev=1165376&r1=1165375&r2=1165376&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/ParallelMultiSearcher.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/ParallelMultiSearcher.cs
Mon Sep  5 18:29:31 2011
@@ -76,7 +76,7 @@ namespace Lucene.Net.Search
 		private int[] starts;
 		
 		/// <summary>Creates a searchable which searches <i>searchables</i>.
</summary>
-		public ParallelMultiSearcher(Searchable[] searchables):base(searchables)
+		public ParallelMultiSearcher(params Searchable[] searchables):base(searchables)
 		{
 			this.searchables = searchables;
 			this.starts = GetStarts();
@@ -247,7 +247,7 @@ namespace Lucene.Net.Search
 		private int i;
         private PriorityQueue<ScoreDoc> hq;
 		private int[] starts;
-		private System.IO.IOException ioe;
+		private System.Exception ioe;
 		private Sort sort;
 		
 		public MultiSearcherThread(Searchable searchable, Weight weight, Filter filter, int nDocs,
HitQueue hq, int i, int[] starts, System.String name):base(name)
@@ -280,10 +280,10 @@ namespace Lucene.Net.Search
 				docs = (sort == null)?searchable.Search(weight, filter, nDocs):searchable.Search(weight,
filter, nDocs, sort);
 			}
 			// Store the IOException for later use by the caller of this thread
-			catch (System.IO.IOException ioe)
-			{
-				this.ioe = ioe;
-			}
+            catch (System.Exception e)
+            {
+                this.ioe = e;
+            }
 			if (this.ioe == null)
 			{
 				// if we are sorting by fields, we need to tell the field sorted hit queue
@@ -340,7 +340,8 @@ namespace Lucene.Net.Search
 		
 		public virtual System.IO.IOException GetIOException()
 		{
-			return ioe;
+            if (ioe == null) return null;
+            return new System.IO.IOException(ioe.Message);
 		}
 	}
 }
\ No newline at end of file



Mime
View raw message