From e76d2a5d4a78abbdbd3cbcd3c264a94690b20e26 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 4 Nov 2022 18:36:58 +0000 Subject: [PATCH] Change the output error message back to use OpenSearchException in the cause chain (#5081) Signed-off-by: Xue Zhou (cherry picked from commit d479853e5edddc648be2f174ea1cf01f0fabcdb3) Signed-off-by: github-actions[bot] # Conflicts: # CHANGELOG.md --- 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; }