From 93ee17eebdb07b5228935e2e0a5511e4c9aacff8 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:14:44 -0800 Subject: [PATCH] Change the output error message back to use OpenSearchException in the cause chain (#5081) (#5084) Signed-off-by: Xue Zhou (cherry picked from commit d479853e5edddc648be2f174ea1cf01f0fabcdb3) --- 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; }