Skip to content

Commit

Permalink
display mapping conflict errors to the user, fixed #79
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Alger committed May 2, 2014
1 parent 6c7064d commit 35c3b61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions src/kibana/apps/settings/controllers/indices.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
};

Expand Down
2 changes: 1 addition & 1 deletion src/kibana/components/courier/_errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 35c3b61

Please sign in to comment.