Skip to content

Commit

Permalink
Add error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Aug 3, 2020
1 parent eee3a42 commit 295f3de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ElasticSearchPost.java
Expand Up @@ -47,10 +47,10 @@ public static int saveDoc(String elasticsearch_url, String index_base, JSONObjec
int code = connection.getResponseCode();
if (code != 201)
{
System.out.println("Elastic search doc code: 201");
System.out.println("Elastic search doc code: " + code);
System.out.println("Input: " + doc.toJSONString());

Scanner scan = new Scanner(connection.getInputStream());
Scanner scan = new Scanner(connection.getErrorStream());
while(scan.hasNextLine())
{
System.out.println(scan.nextLine());
Expand Down

0 comments on commit 295f3de

Please sign in to comment.