ShardSearchFailure handling of exception does not take actual into account for status
fixes #2495
This commit is contained in:
parent
2f4b759df7
commit
2a57e7cd4b
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue