You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2025/03/05 14:23:11 UTC

(jackrabbit-oak) 01/01: OAK-11553 Elastic: index name is swallowed in case of IllegalArgumentException

This is an automated email from the ASF dual-hosted git repository.

thomasm pushed a commit to branch OAK-11553
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git

commit 34d8e5b5b6fbfcbe7ba12a4545a4aa418f815e7e
Author: Thomas Mueller <th...@apache.org>
AuthorDate: Wed Mar 5 15:22:53 2025 +0100

    OAK-11553 Elastic: index name is swallowed in case of IllegalArgumentException
---
 .../oak/plugins/index/elastic/index/ElasticIndexWriter.java       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
index 59d9ba3873..883e57f475 100644
--- a/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
+++ b/oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
@@ -185,7 +185,13 @@ class ElasticIndexWriter implements FulltextIndexWriter<ElasticDocument> {
             return;
         }
 
-        final CreateIndexRequest request = ElasticIndexHelper.createIndexRequest(indexName, indexDefinition);
+        CreateIndexRequest request;
+        try {
+            request = ElasticIndexHelper.createIndexRequest(indexName, indexDefinition);
+        } catch (IllegalArgumentException e) {
+            LOG.warn("Failed to create index {}", indexName, e);
+            throw e;
+        }
         LOG.debug("Creating Index with request {}", request);
         // create the new index
         try {