Skip to content

Commit 5b11880

Browse files
MappingUpdatedAction no unwrap
Removed workaround for guessRootCauses returning wrapper. Relates elastic#50525 and elastic#50417
1 parent 125feec commit 5b11880

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

server/src/main/java/org/elasticsearch/cluster/action/index/MappingUpdatedAction.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,8 @@ public void onResponse(AcknowledgedResponse acknowledgedResponse) {
8484

8585
@Override
8686
public void onFailure(Exception e) {
87-
listener.onFailure(unwrapException(e));
87+
listener.onFailure(e);
8888
}
8989
});
9090
}
91-
92-
// todo: this explicit unwrap should not be necessary, but is until guessRootCause is fixed to allow wrapped non-es exception.
93-
private static Exception unwrapException(Exception cause) {
94-
return cause instanceof ElasticsearchException ? unwrapEsException((ElasticsearchException) cause) : cause;
95-
}
96-
97-
private static RuntimeException unwrapEsException(ElasticsearchException esEx) {
98-
Throwable root = esEx.unwrapCause();
99-
if (root instanceof RuntimeException) {
100-
return (RuntimeException) root;
101-
}
102-
return new UncategorizedExecutionException("Failed execution", root);
103-
}
10491
}

0 commit comments

Comments
 (0)