Skip to content

Commit

Permalink
correct error logging for bulk requests
Browse files Browse the repository at this point in the history
  • Loading branch information
vsboldakov committed Jun 16, 2019
1 parent 53ff70b commit 33fa121
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/sink/ElasticSinkTask.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ class ElasticSinkTask extends SinkTask {
}

this.esClient.bulk({
body
}).then(function () {
body,
}).then(function (data) {
if (data && data.body && data.errors) {
console.error(data.body);
}
self._stats.totalUpserts += upserts.length;
callback();
}).catch((err) => {
console.error(err);
self._stats.bulkUpsertErrors++;
return callback(err);
});
Expand Down

0 comments on commit 33fa121

Please sign in to comment.