From 5b11880373d44a7e1652835f54ffd09ec5fb7d02 Mon Sep 17 00:00:00 2001 From: Henning Andersen Date: Wed, 8 Jan 2020 19:14:40 +0100 Subject: [PATCH 1/2] MappingUpdatedAction no unwrap Removed workaround for guessRootCauses returning wrapper. Relates #50525 and #50417 --- .../action/index/MappingUpdatedAction.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java b/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java index a46f003b375b4..5a0b6e0d29b30 100644 --- a/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java +++ b/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java @@ -84,21 +84,8 @@ public void onResponse(AcknowledgedResponse acknowledgedResponse) { @Override public void onFailure(Exception e) { - listener.onFailure(unwrapException(e)); + listener.onFailure(e); } }); } - - // todo: this explicit unwrap should not be necessary, but is until guessRootCause is fixed to allow wrapped non-es exception. - private static Exception unwrapException(Exception cause) { - return cause instanceof ElasticsearchException ? unwrapEsException((ElasticsearchException) cause) : cause; - } - - private static RuntimeException unwrapEsException(ElasticsearchException esEx) { - Throwable root = esEx.unwrapCause(); - if (root instanceof RuntimeException) { - return (RuntimeException) root; - } - return new UncategorizedExecutionException("Failed execution", root); - } } From 11a6f29d5175f5c58324cb9bc7a8657e78768857 Mon Sep 17 00:00:00 2001 From: Henning Andersen Date: Wed, 8 Jan 2020 19:18:14 +0100 Subject: [PATCH 2/2] Fixed imports. --- .../cluster/action/index/MappingUpdatedAction.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java b/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java index 5a0b6e0d29b30..ad7c566351b89 100644 --- a/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java +++ b/server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java @@ -19,7 +19,6 @@ package org.elasticsearch.cluster.action.index; -import org.elasticsearch.ElasticsearchException; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.MasterNodeRequest; @@ -31,7 +30,6 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.common.util.concurrent.UncategorizedExecutionException; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.index.Index; import org.elasticsearch.index.mapper.MapperService;