Merge "Handle error in front-end"
authorAric Gardner <agardner@linuxfoundation.org>
Mon, 11 Sep 2017 20:11:20 +0000 (20:11 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Mon, 11 Sep 2017 20:11:20 +0000 (20:11 +0000)
utils/test/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js

index 894fcc1..8015bec 100644 (file)
                     details: ctrl.details
                 };
                 ctrl.podsRequest =
-                    $http.post(pods_url, body).error(function (error) {
+                    $http.post(pods_url, body).error(function (data, status) {
                         ctrl.showError = true;
-                        ctrl.error =
-                            'Error creating the new pod from server: ' +
-                            angular.toJson(error);
+                        if(status == 403){
+                            ctrl.error =
+                                'Error creating the new pod from server: Pod\'s name already exists'
+                        }
                     });
             }
             else{