nfsantos commented on code in PR #2139: URL: https://github.com/apache/jackrabbit-oak/pull/2139#discussion_r1981655263
########## oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java: ########## @@ -185,7 +185,13 @@ private void provisionIndex() throws IOException { 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; Review Comment: Won't the exception be logged twice? Maybe here we could just print the `.toString()` of the exception (in addition to the index name) and then let the top level handler that catches this exception log the stack trace, to avoid duplicate traces in the logs. Or create a new exception wrapping this exception and with a message that includes the index name. This could be nicer to have a single log entry with all the information, index name and stack trace. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org