From 5be5ee9b1b80e9482ef28e12bc185d38d7ee7f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 5 Mar 2015 12:25:48 +0100 Subject: [PATCH] Fixed panel error handling issue --- src/app/features/panel/panelSrv.js | 11 +++-------- src/app/panels/graph/module.js | 4 ++-- src/css/less/sidemenu.less | 2 +- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/app/features/panel/panelSrv.js b/src/app/features/panel/panelSrv.js index a3206803c5f..a490c6168ed 100644 --- a/src/app/features/panel/panelSrv.js +++ b/src/app/features/panel/panelSrv.js @@ -104,14 +104,9 @@ function (angular, _, config) { $scope.getCurrentDatasource().then(function(datasource) { $scope.datasource = datasource; - - var promise = $scope.refreshData($scope.datasource); - if (promise) { - promise.then(function() { $scope.panelMeta.loading = false; }); - } else { - $scope.panelMeta.loading = false; - } - + return $scope.refreshData($scope.datasource) || $q.when({}); + }).then(function() { + $scope.panelMeta.loading = false; }, function(err) { console.log('Panel data error:', err); $scope.panelMeta.loading = false; diff --git a/src/app/panels/graph/module.js b/src/app/panels/graph/module.js index 25b7214251e..d14d30fd300 100644 --- a/src/app/panels/graph/module.js +++ b/src/app/panels/graph/module.js @@ -129,10 +129,10 @@ function (angular, app, $, _, kbn, moment, TimeSeries, PanelMeta) { $scope.annotationsPromise = annotationsSrv.getAnnotations($scope.rangeUnparsed, $scope.dashboard); return panelHelper.issueMetricQuery($scope, datasource) - .then($scope.dataHandler) - .then(null, function() { + .then($scope.dataHandler, function(err) { $scope.seriesList = []; $scope.render([]); + throw err; }); }; diff --git a/src/css/less/sidemenu.less b/src/css/less/sidemenu.less index 33654a2f6e5..4b1e5f481e7 100644 --- a/src/css/less/sidemenu.less +++ b/src/css/less/sidemenu.less @@ -116,7 +116,7 @@ opacity: .7; position: relative; left: 7px; - top: 3px; + top: 5px; font-size: 150%; } }