add the cause to query phase execption

This commit is contained in:
kimchy 2010-02-20 03:34:42 +02:00
parent 1aa8e01184
commit 21a1021bdb
2 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ public class QueryPhase implements SearchPhase {
}
searchContext.queryResult().topDocs(topDocs);
} catch (Exception e) {
throw new QueryPhaseExecutionException(searchContext);
throw new QueryPhaseExecutionException(searchContext, e);
}
facetsPhase.execute(searchContext);

View File

@ -27,7 +27,7 @@ import org.elasticsearch.search.internal.SearchContext;
*/
public class QueryPhaseExecutionException extends SearchException {
public QueryPhaseExecutionException(SearchContext context) {
super("Failed to execute query [" + context.query() + "], sort [" + context.sort() + "], from [" + context.from() + "], size [" + context.size() + "]");
public QueryPhaseExecutionException(SearchContext context, Throwable cause) {
super("Failed to execute query [" + context.query() + "], sort [" + context.sort() + "], from [" + context.from() + "], size [" + context.size() + "]", cause);
}
}