From b945e644f45ffa84d03b7653f2465c4f400a350e Mon Sep 17 00:00:00 2001 From: Megha Goyal Date: Sun, 18 Feb 2024 23:00:39 -0800 Subject: [PATCH] Push exception type in the list of errors Signed-off-by: Megha Goyal --- .../securityanalytics/util/SecurityAnalyticsException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/securityanalytics/util/SecurityAnalyticsException.java b/src/main/java/org/opensearch/securityanalytics/util/SecurityAnalyticsException.java index bd67ed642..471043476 100644 --- a/src/main/java/org/opensearch/securityanalytics/util/SecurityAnalyticsException.java +++ b/src/main/java/org/opensearch/securityanalytics/util/SecurityAnalyticsException.java @@ -77,7 +77,7 @@ public static OpenSearchException wrap(List ex) { XContentBuilder builder = XContentFactory.jsonBuilder().startObject(); for (Exception e: ex) { - builder.field("error", e.getMessage()); + builder.field(e.getClass().getSimpleName(), e.getMessage()); log.warn("[CUSTOMER ERROR] Security Analytics error:", e); } builder.endObject();