diff --git a/src/kibana/apps/settings/controllers/indices.js b/src/kibana/apps/settings/controllers/indices.js index bb12308bd3a7c..fb99299bcc439 100644 --- a/src/kibana/apps/settings/controllers/indices.js +++ b/src/kibana/apps/settings/controllers/indices.js @@ -58,13 +58,21 @@ define(function (require) { // refresh the fields, to verify that the $scope.indexPattern.refreshFields() - .then(refreshKibanaIndex) - .then(function () { - $location.path('/settings/indices/' + $scope.indexPattern.id); - }) .catch(function (err) { - if (err.status >= 400) notify.error('Could not locate any indices matching that pattern. Please add the index to Elasticsearch'); - else notify.fatal(err); + notify.error(err); + delete $scope.indexPattern.id; + // rethrow to prevent second branch + throw err; + }) + .then(function () { + refreshKibanaIndex() + .then(function () { + $location.path('/settings/indices/' + $scope.indexPattern.id); + }) + .catch(function (err) { + if (err.status >= 400) notify.error('Could not locate any indices matching that pattern. Please add the index to Elasticsearch'); + else notify.fatal(err); + }); }); }; diff --git a/src/kibana/components/courier/_errors.js b/src/kibana/components/courier/_errors.js index 9792ceecfd1a9..40e2153cb4a4e 100644 --- a/src/kibana/components/courier/_errors.js +++ b/src/kibana/components/courier/_errors.js @@ -87,7 +87,7 @@ define(function (require) { */ errors.MappingConflict = function MappingConflict(field) { CourierError.call(this, - 'Field ' + field + ' is defined as at least two different types in indices matching the pattern', + 'Field "' + field + '" is defined with at least two different types in indices matching the pattern', errors.MappingConflict); }; inherits(errors.MappingConflict, CourierError);