ShardSearchFailure handling of exception does not take actual into account for status

fixes #2495
This commit is contained in:
Shay Banon 2012-12-26 14:56:31 -08:00
parent 2f4b759df7
commit 2a57e7cd4b
1 changed files with 1 additions and 3 deletions

View File

@ -35,8 +35,6 @@ import static org.elasticsearch.search.SearchShardTarget.readSearchShardTarget;
/**
* Represents a failure to search on a specific shard.
*
*
*/
public class ShardSearchFailure implements ShardOperationFailedException {
@ -58,7 +56,7 @@ public class ShardSearchFailure implements ShardOperationFailedException {
this.shardTarget = ((SearchException) actual).shard();
}
if (actual != null && actual instanceof ElasticSearchException) {
status = ((ElasticSearchException) t).status();
status = ((ElasticSearchException) actual).status();
} else {
status = RestStatus.INTERNAL_SERVER_ERROR;
}