From f4045f50ee78918d658bfcc3788eff1bcf0a8593 Mon Sep 17 00:00:00 2001 From: Subho Banerjee Date: Sat, 10 Nov 2012 12:59:00 +0530 Subject: [PATCH] partial fix --- public/js/page.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/js/page.js b/public/js/page.js index db0ed0e..cfe8168 100644 --- a/public/js/page.js +++ b/public/js/page.js @@ -85,7 +85,11 @@ var App = function ($scope, $http) { setError('The server is broken! Retry in a while'); break; default: - setError('Error in contacting server!'); + var str = 'Error in contacting server!'; + if (data.error) { + var str = JSON.parse(data.error).messages[0].text + } + setError(str); break; } }; @@ -374,7 +378,7 @@ var App = function ($scope, $http) { $scope.deploy = function () { // Deploy the graph to a openshift broker Busy.start(); for (var i in $scope.graph.vertices) { - if ($scope.graph.vertices[i].cartridges.length === 0) { + if ($scope.graph.vertices[i].cartridges && $scope.graph.vertices[i].cartridges.length === 0) { setError('First add cartridges to all nodes'); Busy.stop(); return;