mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Add error handling
This commit is contained in:
@@ -56,13 +56,30 @@ angular.module('Organizations', [
|
|||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
add: {
|
add: {
|
||||||
ConfigData: ['ConfigService', (ConfigService) => {
|
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||||
return ConfigService.getConfig().then(response => response);
|
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: {
|
edit: {
|
||||||
ConfigData: ['ConfigService', (ConfigService) => {
|
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||||
return ConfigService.getConfig().then(response => response);
|
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',
|
InstanceGroupsData: ['$stateParams', 'Rest', 'GetBasePath', 'ProcessErrors',
|
||||||
function($stateParams, Rest, GetBasePath, ProcessErrors){
|
function($stateParams, Rest, GetBasePath, ProcessErrors){
|
||||||
|
|||||||
@@ -48,8 +48,16 @@ angular.module('Projects', [])
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
ConfigData: ['ConfigService', (ConfigService) => {
|
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||||
return ConfigService.getConfig().then(response => response);
|
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) => {
|
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||||
return ConfigService.getConfig().then(response => response);
|
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) => {
|
ConfigData: ['ConfigService', 'ProcessErrors', (ConfigService, ProcessErrors) => {
|
||||||
return ConfigService.getConfig().then(response => response);
|
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
|
||||||
|
});
|
||||||
|
});
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user