From 44e02c03421d9f40e83799c9ddd688be47f3d3b3 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Fri, 2 Sep 2016 17:59:32 +1200 Subject: [PATCH] fix(network): add missing exception management --- app/components/network/networkController.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/app/components/network/networkController.js b/app/components/network/networkController.js index 159a48677..8d55ce70c 100644 --- a/app/components/network/networkController.js +++ b/app/components/network/networkController.js @@ -10,7 +10,7 @@ function ($scope, Network, Messages, $state, $stateParams) { $state.go('network', {id: $stateParams.id}, {reload: true}); }, function (e) { $('#loadingViewSpinner').hide(); - Messages.error("Failure", e.data); + Messages.error("Failure", e, "Unable to disconnect container"); }); }; @@ -19,7 +19,7 @@ function ($scope, Network, Messages, $state, $stateParams) { Network.remove({id: $stateParams.id}, function (d) { if (d.message) { $('#loadingViewSpinner').hide(); - Messages.send("Error", d.message); + Messages.send("Error", {}, d.message); } else { $('#loadingViewSpinner').hide(); Messages.send("Network removed", $stateParams.id); @@ -27,11 +27,7 @@ function ($scope, Network, Messages, $state, $stateParams) { } }, function (e) { $('#loadingViewSpinner').hide(); - if (e.data.message) { - Messages.error("Failure", e.data.message); - } else { - Messages.error("Failure", 'Unable to remove network'); - } + Messages.error("Failure", e, "Unable to remove network"); }); }; @@ -40,7 +36,7 @@ function ($scope, Network, Messages, $state, $stateParams) { $scope.network = d; $('#loadingViewSpinner').hide(); }, function (e) { - Messages.error("Failure", e.data); $('#loadingViewSpinner').hide(); + Messages.error("Failure", e, "Unable to retrieve network info"); }); }]);