mirror of https://github.com/apache/lucene.git
add the original query to the parse exception message for easier debugging
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@424708 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f72c1e579f
commit
53888844c0
|
@ -121,11 +121,15 @@ public class QueryParser implements QueryParserConstants {
|
||||||
try {
|
try {
|
||||||
return Query(field);
|
return Query(field);
|
||||||
}
|
}
|
||||||
|
catch (ParseException tme) {
|
||||||
|
// rethrow to include the original query:
|
||||||
|
throw new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
|
||||||
|
}
|
||||||
catch (TokenMgrError tme) {
|
catch (TokenMgrError tme) {
|
||||||
throw new ParseException(tme.getMessage());
|
throw new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
|
||||||
}
|
}
|
||||||
catch (BooleanQuery.TooManyClauses tmc) {
|
catch (BooleanQuery.TooManyClauses tmc) {
|
||||||
throw new ParseException("Too many boolean clauses");
|
throw new ParseException("Cannot parse '" +query+ "': too many boolean clauses");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,11 +144,15 @@ public class QueryParser {
|
||||||
try {
|
try {
|
||||||
return Query(field);
|
return Query(field);
|
||||||
}
|
}
|
||||||
|
catch (ParseException tme) {
|
||||||
|
// rethrow to include the original query:
|
||||||
|
throw new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
|
||||||
|
}
|
||||||
catch (TokenMgrError tme) {
|
catch (TokenMgrError tme) {
|
||||||
throw new ParseException(tme.getMessage());
|
throw new ParseException("Cannot parse '" +query+ "': " + tme.getMessage());
|
||||||
}
|
}
|
||||||
catch (BooleanQuery.TooManyClauses tmc) {
|
catch (BooleanQuery.TooManyClauses tmc) {
|
||||||
throw new ParseException("Too many boolean clauses");
|
throw new ParseException("Cannot parse '" +query+ "': too many boolean clauses");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue