Skip to content

Commit

Permalink
Ensure we do not lose exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontedor committed Sep 13, 2018
1 parent d4f8a98 commit 2890693
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,14 @@ protected void asyncShardOperation(
if (g == UNASSIGNED_SEQ_NO) {
assert e != null;
if (e instanceof TimeoutException) {
final long mappingVersion =
clusterService.state().metaData().index(shardId.getIndex()).getMappingVersion();
final SeqNoStats latestSeqNoStats = indexShard.seqNoStats();
listener.onResponse(getResponse(mappingVersion, latestSeqNoStats, EMPTY_OPERATIONS_ARRAY));
try {
final long mappingVersion =
clusterService.state().metaData().index(shardId.getIndex()).getMappingVersion();
final SeqNoStats latestSeqNoStats = indexShard.seqNoStats();
listener.onResponse(getResponse(mappingVersion, latestSeqNoStats, EMPTY_OPERATIONS_ARRAY));
} catch (final Exception caught) {
listener.onFailure(caught);
}
} else {
listener.onFailure(e);
}
Expand Down

0 comments on commit 2890693

Please sign in to comment.