From 31905d1bf29e91425bd449110035919bd05301ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 4 Nov 2022 18:36:56 +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; }