[ML] Ensure Anomaly Explorer and Single View do not hang by fixing TypeError: finally is not a function (#25961)

* Replace finally with catch/then to fix typeError

* update error messages
This commit is contained in:
Melissa Alvarez 2018-11-21 11:24:24 -08:00 committed by GitHub
parent b3ef0c4eaf
commit 9ea7720b50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -264,7 +264,8 @@ module.controller('MlExplorerController', function (
// Populate the map of jobs / detectors / field formatters for the selected IDs.
mlFieldFormatService.populateFormats(selectedIds, getIndexPatterns())
.finally(() => {
.catch((err) => { console.log('Error populating field formats:', err); })
.then(() => {
// Load the data - if the FieldFormats failed to populate
// the default formatting will be used for metric values.
loadOverallData();

View file

@ -673,9 +673,10 @@ module.controller('MlTimeSeriesExplorerController', function (
// Populate the map of jobs / detectors / field formatters for the selected IDs and refresh.
mlFieldFormatService.populateFormats([jobId], getIndexPatterns())
.finally(() => {
// Load the data - if the FieldFormats failed to populate
// the default formatting will be used for metric values.
.catch((err) => { console.log('Error populating field formats:', err); })
// Load the data - if the FieldFormats failed to populate
// the default formatting will be used for metric values.
.then(() => {
$scope.refresh();
});
}