Catch and ignore index_not_found_exception when deleting kibana index if not found.
This commit is contained in:
parent
fd225796f7
commit
e4e1e66b52
1 changed files with 9 additions and 2 deletions
9
test/fixtures/scenarioManager.js
vendored
9
test/fixtures/scenarioManager.js
vendored
|
@ -62,6 +62,13 @@ ScenarioManager.prototype.unload = function (id) {
|
||||||
|
|
||||||
return this.client.indices.delete({
|
return this.client.indices.delete({
|
||||||
index: indices
|
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,7 +117,7 @@ ScenarioManager.prototype.loadIfEmpty = function (id) {
|
||||||
if (response.count === 0) {
|
if (response.count === 0) {
|
||||||
return self.load(id);
|
return self.load(id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}))
|
}))
|
||||||
.catch(function (reason) {
|
.catch(function (reason) {
|
||||||
return self.load(id);
|
return self.load(id);
|
||||||
|
|
Loading…
Reference in a new issue