From 398ac24b34341e57258cd0e1499e00750d29941b Mon Sep 17 00:00:00 2001 From: "Van Eenwyk, Jonathan" Date: Mon, 20 Jan 2014 11:14:19 -0700 Subject: [PATCH] histogram: on error search remaining indices If one index search fails (due to bad or missing data), continue the search through the remaining indices/segments, so that we can show some data despite the missing information. --- src/app/panels/histogram/module.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/app/panels/histogram/module.js b/src/app/panels/histogram/module.js index bc7f970e45826..7273dbc8124a5 100644 --- a/src/app/panels/histogram/module.js +++ b/src/app/panels/histogram/module.js @@ -394,11 +394,9 @@ function (angular, app, $, _, kbn, moment, timeSeries, numeral) { // Check for error and abort if found if(!(_.isUndefined(results.error))) { $scope.panel.error = $scope.parse_error(results.error); - return; } - // Make sure we're still on the same query/queries - if($scope.query_id === query_id) { + else if($scope.query_id === query_id) { var i = 0, time_series, @@ -495,14 +493,14 @@ function (angular, app, $, _, kbn, moment, timeSeries, numeral) { // And slice to the right size $scope.annotations = $scope.annotations.slice(0,$scope.panel.annotate.size); } + } - // Tell the histogram directive to render. - $scope.$emit('render', data); + // Tell the histogram directive to render. + $scope.$emit('render', data); - // If we still have segments left, get them - if(segment < dashboard.indices.length-1) { - $scope.get_data(data,segment+1,query_id); - } + // If we still have segments left, get them + if(segment < dashboard.indices.length-1) { + $scope.get_data(data,segment+1,query_id); } }); };