Prevent refresh fields error from breaking index patterns management page (#11885)

* No longer throw an error to the rest of the stack if there is an error refreshing fields for an index pattern

* Only prevent rethrowing for the certain error scenario
This commit is contained in:
Chris Roberson 2017-05-18 14:14:06 -04:00
parent b170a224b7
commit 25d27b8be8

View file

@ -1,5 +1,5 @@
import _ from 'lodash';
import { SavedObjectNotFound, DuplicateField } from 'ui/errors';
import { SavedObjectNotFound, DuplicateField, IndexPatternMissingIndices } from 'ui/errors';
import angular from 'angular';
import getComputedFields from 'ui/index_patterns/_get_computed_fields';
import formatHit from 'ui/index_patterns/_format_hit';
@ -366,6 +366,15 @@ export default function IndexPatternFactory(Private, Notifier, config, kbnIndex,
.then(() => this.save())
.catch((err) => {
notify.error(err);
// https://github.com/elastic/kibana/issues/9224
// This call will attempt to remap fields from the matching
// ES index which may not actually exist. In that scenario,
// we still want to notify the user that there is a problem
// but we do not want to potentially make any pages unusable
// so do not rethrow the error here
if (err instanceof IndexPatternMissingIndices) {
return;
}
return Promise.reject(err);
});
}