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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 49913d25ee OAK-11553 Elastic: index name is swallowed in case of 
IllegalArgument… (#2139)
49913d25ee is described below

commit 49913d25ee03cb3a79cf63d106333214f330106e
Author: Thomas Mueller <[email protected]>
AuthorDate: Thu Mar 6 10:18:21 2025 +0100

    OAK-11553 Elastic: index name is swallowed in case of IllegalArgument… 
(#2139)
    
    * OAK-11553 Elastic: index name is swallowed in case of 
IllegalArgumentException
    
    * OAK-11553 Elastic: index name is swallowed in case of 
IllegalArgumentException
    
    * Update 
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
    
    * Update 
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
---
 .../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..f77de098e6 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 (Exception e) {
+            LOG.error("Failed to create index {}: {}", indexName, 
e.toString());
+            throw e;
+        }
         LOG.debug("Creating Index with request {}", request);
         // create the new index
         try {

Reply via email to