From ae5b309de09c9f4f87df8d6ac07876fd8d00df5d Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Tue, 12 Sep 2017 10:21:52 -0700 Subject: [PATCH] catching org save error the org PUT was missing a .catch, however the edit controller already had it. --- .../organizations/add/organizations-add.controller.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/organizations/add/organizations-add.controller.js b/awx/ui/client/src/organizations/add/organizations-add.controller.js index 2a43f8652d..fbd0957153 100644 --- a/awx/ui/client/src/organizations/add/organizations-add.controller.js +++ b/awx/ui/client/src/organizations/add/organizations-add.controller.js @@ -54,9 +54,16 @@ export default ['$scope', '$rootScope', '$location', '$stateParams', .catch(({data, status}) => { ProcessErrors($scope, data, status, form, { hdr: 'Error!', - msg: 'Failed to add new organization. Post returned status: ' + status + msg: 'Failed to save instance groups. POST returned status: ' + status }); }); + }) + .catch(({data, status}) => { + let explanation = _.has(data, "name") ? data.name[0] : ""; + ProcessErrors($scope, data, status, OrganizationForm, { + hdr: 'Error!', + msg: `Failed to save organization. PUT status: ${status}. ${explanation}` + }); }); };