diff --git a/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js b/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js index 3d7d6b09ff..f30afabf36 100644 --- a/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js +++ b/awx/ui/client/lib/components/relaunchButton/relaunchButton.component.js @@ -117,6 +117,11 @@ function atRelaunchCtrl ( const relaunchType = launchRes.data.type === 'job' ? 'playbook' : launchRes.data.type; $state.go('jobz', { id: launchRes.data.id, type: relaunchType }, { reload: true }); } + }).catch(({ data, status, config }) => { + ProcessErrors($scope, data, status, null, { + hdr: strings.get('error.HEADER'), + msg: strings.get('error.CALL', { path: `${config.url}`, status }) + }); }); } }); @@ -165,6 +170,11 @@ function atRelaunchCtrl ( if (!$state.includes('jobs')) { $state.go('jobz', { id: postUpdateRes.data.id, type: 'inventory' }, { reload: true }); } + }).catch(({ data, status, config }) => { + ProcessErrors($scope, data, status, null, { + hdr: strings.get('error.HEADER'), + msg: strings.get('error.CALL', { path: `${config.url}`, status }) + }); }); } else { Alert( @@ -184,6 +194,11 @@ function atRelaunchCtrl ( if (!$state.includes('jobs')) { $state.go('jobz', { id: postUpdateRes.data.id, type: 'project' }, { reload: true }); } + }).catch(({ data, status, config }) => { + ProcessErrors($scope, data, status, null, { + hdr: strings.get('error.HEADER'), + msg: strings.get('error.CALL', { path: `${config.url}`, status }) + }); }); } else { Alert( @@ -201,6 +216,11 @@ function atRelaunchCtrl ( if (!$state.includes('jobs')) { $state.go('workflowResults', { id: launchRes.data.id }, { reload: true }); } + }).catch(({ data, status, config }) => { + ProcessErrors($scope, data, status, null, { + hdr: strings.get('error.HEADER'), + msg: strings.get('error.CALL', { path: `${config.url}`, status }) + }); }); } else if (vm.job.type === 'ad_hoc_command') { const adHocCommand = new AdHocCommand(); @@ -220,6 +240,11 @@ function atRelaunchCtrl ( if (!$state.includes('jobs')) { $state.go('jobz', { id: launchRes.data.id, type: 'command' }, { reload: true }); } + }).catch(({ data, status, config }) => { + ProcessErrors($scope, data, status, null, { + hdr: strings.get('error.HEADER'), + msg: strings.get('error.CALL', { path: `${config.url}`, status }) + }); }); } }); diff --git a/awx/ui/client/src/shared/Utilities.js b/awx/ui/client/src/shared/Utilities.js index 23d593ccd2..301a7eae9d 100644 --- a/awx/ui/client/src/shared/Utilities.js +++ b/awx/ui/client/src/shared/Utilities.js @@ -222,14 +222,14 @@ angular.module('Utilities', ['RestServices', 'Utilities']) } else if (typeof data === 'object' && data !== null) { if (Object.keys(data).length > 0) { keys = Object.keys(data); - if (Array.isArray(data[keys[0]])) { - msg = data[keys[0]][0]; - } else { - msg = ""; - _.forOwn(data, function(value, key) { + msg = ""; + _.forOwn(data, function(value, key) { + if (Array.isArray(data[key])) { + msg += `${key}: ${data[key][0]}`; + } else { msg += `${key} : ${value} `; - }); - } + } + }); Alert(defaultMsg.hdr, msg); } else { Alert(defaultMsg.hdr, defaultMsg.msg);