From d9e8960951aa68f8839f35ef16cf4b2469db2b97 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:20:14 -0600 Subject: [PATCH] Change the output error message back to use OpenSearchException in the cause chain (#5081) (#5085) Signed-off-by: Xue Zhou (cherry picked from commit d479853e5edddc648be2f174ea1cf01f0fabcdb3) Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- server/src/main/java/org/opensearch/OpenSearchException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/OpenSearchException.java b/server/src/main/java/org/opensearch/OpenSearchException.java index 5cf64f873e5cc..a8107a80ea8b7 100644 --- a/server/src/main/java/org/opensearch/OpenSearchException.java +++ b/server/src/main/java/org/opensearch/OpenSearchException.java @@ -603,7 +603,7 @@ public static void generateFailureXContent(XContentBuilder builder, Params param } t = t.getCause(); } - builder.field(ERROR, ExceptionsHelper.summaryMessage(e)); + builder.field(ERROR, ExceptionsHelper.summaryMessage(t != null ? t : e)); return; }