summaryrefslogtreecommitdiffstats
path: root/testapi
diff options
context:
space:
mode:
authorthuva4 <tharma.thuva@gmail.com>2017-09-11 19:32:19 +0530
committerthuva4 <tharma.thuva@gmail.com>2017-09-11 19:32:19 +0530
commit0ca0e26817107bb57602cec3b5f94e6b43e9112c (patch)
tree952578ec719e8a111d5150ee5866d364fbf447ec /testapi
parentd6a91e242d2cd5ba1c1cb4e15d843310fc5347b7 (diff)
Handle error in front-end
Handle the error and show appropriate message, without showing the entire error to the users Change-Id: Ib5213190efc1e87d56a7329a4572b525a5e16a12 Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi')
-rw-r--r--testapi/3rd_party/static/testapi-ui/components/pods/podsController.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js b/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js
index 894fcc1..8015bec 100644
--- a/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js
+++ b/testapi/3rd_party/static/testapi-ui/components/pods/podsController.js
@@ -88,11 +88,12 @@
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{