mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
Adjust edit template controller to handle deferred promise errors
This commit is contained in:
parent
21f29983bb
commit
21c364d14c
@ -588,6 +588,19 @@ export default
|
||||
.then(function() {
|
||||
Wait('stop');
|
||||
saveCompleted();
|
||||
})
|
||||
.catch(err => {
|
||||
// Handle any potential errors
|
||||
let { data, status, config } = err;
|
||||
const { url } = config;
|
||||
|
||||
// Handle edge case for LABELS endpoint
|
||||
const labelName = "labels";
|
||||
if (url.match(labelName)) {
|
||||
data = { [labelName]: [data['name'][0]] };
|
||||
}
|
||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
||||
msg: 'Failed to update job template. PUT returned status: ' + status });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user