mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Add error handling
This commit is contained in:
parent
23300003ab
commit
8a163b5939
@ -56,13 +56,30 @@ angular.module('Organizations', [
|
||||
},
|
||||
resolve: {
|
||||
add: {
|
||||
ConfigData: ['ConfigService', (ConfigService) => {
|
||||
return ConfigService.getConfig().then(response => response);
|
||||
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||
return ConfigService.getConfig()
|
||||
.then(response => response)
|
||||
.catch(({data, status}) => {
|
||||
ProcessErrors(null, data, status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Failed to get config. GET returned status: ' +
|
||||
'status: ' + status
|
||||
});
|
||||
});
|
||||
|
||||
}]
|
||||
},
|
||||
edit: {
|
||||
ConfigData: ['ConfigService', (ConfigService) => {
|
||||
return ConfigService.getConfig().then(response => response);
|
||||
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||
return ConfigService.getConfig()
|
||||
.then(response => response)
|
||||
.catch(({data, status}) => {
|
||||
ProcessErrors(null, data, status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Failed to get config. GET returned status: ' +
|
||||
'status: ' + status
|
||||
});
|
||||
});
|
||||
}],
|
||||
InstanceGroupsData: ['$stateParams', 'Rest', 'GetBasePath', 'ProcessErrors',
|
||||
function($stateParams, Rest, GetBasePath, ProcessErrors){
|
||||
|
||||
@ -48,8 +48,16 @@ angular.module('Projects', [])
|
||||
});
|
||||
}
|
||||
],
|
||||
ConfigData: ['ConfigService', (ConfigService) => {
|
||||
return ConfigService.getConfig().then(response => response);
|
||||
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||
return ConfigService.getConfig()
|
||||
.then(response => response)
|
||||
.catch(({data, status}) => {
|
||||
ProcessErrors(null, data, status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Failed to get config. GET returned status: ' +
|
||||
'status: ' + status
|
||||
});
|
||||
});
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
@ -130,8 +130,16 @@ angular.module('templates', [surveyMaker.name, jobTemplates.name, labels.name, p
|
||||
});
|
||||
});
|
||||
}],
|
||||
ConfigData: ['ConfigService', (ConfigService) => {
|
||||
return ConfigService.getConfig().then(response => response);
|
||||
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||
return ConfigService.getConfig()
|
||||
.then(response => response)
|
||||
.catch(({data, status}) => {
|
||||
ProcessErrors(null, data, status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Failed to get config. GET returned status: ' +
|
||||
'status: ' + status
|
||||
});
|
||||
});
|
||||
}]
|
||||
}
|
||||
}
|
||||
@ -264,8 +272,16 @@ angular.module('templates', [surveyMaker.name, jobTemplates.name, labels.name, p
|
||||
});
|
||||
});
|
||||
}],
|
||||
ConfigData: ['ConfigService', (ConfigService) => {
|
||||
return ConfigService.getConfig().then(response => response);
|
||||
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||
return ConfigService.getConfig()
|
||||
.then(response => response)
|
||||
.catch(({data, status}) => {
|
||||
ProcessErrors(null, data, status, null, {
|
||||
hdr: 'Error!',
|
||||
msg: 'Failed to get config. GET returned status: ' +
|
||||
'status: ' + status
|
||||
});
|
||||
});
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user