diff --git a/awx/ui/client/features/credentials/index.js b/awx/ui/client/features/credentials/index.js index e3a1ea7734..38e291ef8e 100644 --- a/awx/ui/client/features/credentials/index.js +++ b/awx/ui/client/features/credentials/index.js @@ -7,7 +7,16 @@ const MODULE_NAME = 'at.features.credentials'; const addEditTemplate = require('~features/credentials/add-edit-credentials.view.html'); -function CredentialsResolve ($q, $stateParams, Me, Credential, CredentialType, Organization) { +function CredentialsResolve ( + $q, + $stateParams, + Me, + Credential, + CredentialType, + Organization, + ProcessErrors, + strings +) { const id = $stateParams.credential_id; const promises = { @@ -43,6 +52,12 @@ function CredentialsResolve ($q, $stateParams, Me, Credential, CredentialType, O return models; }); + }).catch(({ data, status, config }) => { + ProcessErrors(null, data, status, null, { + hdr: strings.get('error.HEADER'), + msg: strings.get('error.CALL', { path: `${config.url}`, status }) + }); + return $q.reject(); }); } @@ -52,7 +67,9 @@ CredentialsResolve.$inject = [ 'MeModel', 'CredentialModel', 'CredentialTypeModel', - 'OrganizationModel' + 'OrganizationModel', + 'ProcessErrors', + 'CredentialsStrings' ]; function CredentialsRun ($stateExtender, legacy, strings) {