Explorar o código

Added error handling to dashboard imports, #1493

Torkel Ödegaard %!s(int64=11) %!d(string=hai) anos
pai
achega
3991d9dc06
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/app/features/account/importCtrl.js

+ 4 - 0
src/app/features/account/importCtrl.js

@@ -43,6 +43,10 @@ function (angular, _) {
         $scope.importing = true;
         $scope.imported = [];
         $scope.next();
+      }, function(err) {
+        var resp = err.message || err.statusText || 'Unknown error';
+        var message = "Failed to load dashboards from selected data source, response from server was: " + resp;
+        $scope.appEvent('alert-error', ['Import failed', message]);
       });
     };