Skip to content

Commit

Permalink
Check for unexpected datatypes in response from server (confluentinc#428
Browse files Browse the repository at this point in the history
)

* Check for unexpected datatypes in response from server

* Update src/main/java/io/confluent/connect/elasticsearch/jest/JestElasticsearchClient.java

Co-authored-by: Lev Zemlyanov <[email protected]>

* fmt

Co-authored-by: Lev Zemlyanov <[email protected]>
  • Loading branch information
cyrusv and Lev Zemlyanov authored Jul 21, 2020
1 parent 99ffc61 commit d7bc835
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ private Version getServerVersion() throws IOException {
LOG.warn("Couldn't get Elasticsearch version, result is null");
return defaultVersion;
}
if (!result.has("nodes")) {
LOG.warn("Couldn't get Elasticsearch version from result {} (result has no nodes). "
+ "Assuming {}.", result, defaultVersion);
return defaultVersion;
}

checkForError(result);

Expand Down

0 comments on commit d7bc835

Please sign in to comment.