lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r787805 - /lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
Date Tue, 23 Jun 2009 19:55:28 GMT
Author: mikemccand
Date: Tue Jun 23 19:55:28 2009
New Revision: 787805

URL: http://svn.apache.org/viewvc?rev=787805&view=rev
Log:
LUCENE-1646: when throwing ParseException from QueryParser, include root cause

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java?rev=787805&r1=787804&r2=787805&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/queryParser/QueryParser.java Tue Jun 23 19:55:28
2009
@@ -174,13 +174,20 @@
     }
     catch (ParseException tme) {
       // rethrow to include the original query:
-      throw new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
+      // rethrow to include the original query:
+      ParseException e = new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
+      e.initCause(tme);
+      throw e;
     }
     catch (TokenMgrError tme) {
-      throw new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
+      ParseException e = new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
+      e.initCause(tme);
+      throw e;
     }
     catch (BooleanQuery.TooManyClauses tmc) {
-      throw new ParseException("Cannot parse '" +query+ "': too many boolean clauses");
+      ParseException e = new ParseException("Cannot parse '" +query+ "': too many boolean
clauses");
+      e.initCause(tmc);
+      throw e;
     }
   }
 



Mime
View raw message