Catch and ignore index_not_found_exception when deleting kibana index if not found.
This commit is contained in:
parent
fd225796f7
commit
e4e1e66b52
11
test/fixtures/scenarioManager.js
vendored
11
test/fixtures/scenarioManager.js
vendored
|
@ -62,6 +62,13 @@ ScenarioManager.prototype.unload = function (id) {
|
|||
|
||||
return this.client.indices.delete({
|
||||
index: indices
|
||||
})
|
||||
.catch(function (reason) {
|
||||
// if the index never existed yet, or was already deleted it's OK
|
||||
if (reason.message.indexOf('index_not_found_exception') < 0) {
|
||||
console.log('reason.message: ' + reason.message);
|
||||
throw reason;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -110,11 +117,11 @@ ScenarioManager.prototype.loadIfEmpty = function (id) {
|
|||
if (response.count === 0) {
|
||||
return self.load(id);
|
||||
}
|
||||
})
|
||||
});
|
||||
}))
|
||||
.catch(function (reason) {
|
||||
return self.load(id);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = ScenarioManager;
|
||||
module.exports = ScenarioManager;
|
||||
|
|
Loading…
Reference in a new issue