From 21a1021bdb7ff3877e9a030d86ad28bac9acf0c6 Mon Sep 17 00:00:00 2001 From: kimchy Date: Sat, 20 Feb 2010 03:34:42 +0200 Subject: [PATCH] add the cause to query phase execption --- .../main/java/org/elasticsearch/search/query/QueryPhase.java | 2 +- .../search/query/QueryPhaseExecutionException.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/query/QueryPhase.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/query/QueryPhase.java index 8a26ab3ea4a..3233e38cce7 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/query/QueryPhase.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/query/QueryPhase.java @@ -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); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/search/query/QueryPhaseExecutionException.java b/modules/elasticsearch/src/main/java/org/elasticsearch/search/query/QueryPhaseExecutionException.java index d52306021ce..dd7f8f82f32 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/search/query/QueryPhaseExecutionException.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/search/query/QueryPhaseExecutionException.java @@ -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); } }