Skip to content

Commit

Permalink
Don't swallow errors on bulk search
Browse files Browse the repository at this point in the history
say what went wrong, as an aid to debugging
  • Loading branch information
mheiber committed Oct 4, 2017
1 parent d323698 commit 8cf2122
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/services/elastic.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,12 @@ function batch(ops) {
body: ops
}).then(function (resp) {
if (resp && resp.errors === true) {
let str = ['Client.bulk errored on ' + util.inspect(ops, {
depth: 10
})];
const message = 'Client.bulk errored on:\n'
+ util.inspect(ops, {depth: 10})
+ '\n response items:\n'
+ util.inspect(resp.items, {depth: 8});

return bluebird.reject(new Error(str));
return bluebird.reject(new Error(message));
}
});
}
Expand Down

0 comments on commit 8cf2122

Please sign in to comment.