mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[scenarioManager] when bulk fails, report errors
This commit is contained in:
parent
94a9e651b0
commit
d248af5702
1 changed files with 12 additions and 0 deletions
12
test/fixtures/scenario_manager.js
vendored
12
test/fixtures/scenario_manager.js
vendored
|
@ -42,6 +42,18 @@ ScenarioManager.prototype.load = function (id) {
|
|||
body: body
|
||||
});
|
||||
})
|
||||
.then(function (response) {
|
||||
if (response.errors) {
|
||||
throw new Error(
|
||||
'bulk failed\n' +
|
||||
response.items
|
||||
.map(i => i[Object.keys(i)[0]].error)
|
||||
.filter(Boolean)
|
||||
.map(err => ' ' + JSON.stringify(err))
|
||||
.join('\n')
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
if (bulk.haltOnFailure === false) return;
|
||||
throw err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue