Merge pull request #6154 from spalger/fix/failTestOnBadBulk
[scenarioManager] when bulk fails, report errors
This commit is contained in:
commit
233869f9c3
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…
Reference in a new issue