Skip to content

Commit 74e5c0f

Browse files
committed
CC-1096 Added ES error message when unable to create an index
1 parent 1ef6b35 commit 74e5c0f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/io/confluent/connect/elasticsearch/ElasticsearchWriter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,8 @@ public void createIndicesForTopics(Set<String> assignedTopics) {
247247
try {
248248
JestResult result = client.execute(createIndex);
249249
if (!result.isSucceeded()) {
250-
throw new ConnectException("Could not create index:" + index);
250+
String msg = result.getErrorMessage() != null ? ": " + result.getErrorMessage() : "";
251+
throw new ConnectException("Could not create index '" + index + "'" + msg);
251252
}
252253
} catch (IOException e) {
253254
throw new ConnectException(e);

0 commit comments

Comments
 (0)