mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
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
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…
Add table
Add a link
Reference in a new issue