mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 14:27:42 -02:30
Adjust edit template controller to handle deferred promise errors
This commit is contained in:
@@ -588,6 +588,19 @@ export default
|
|||||||
.then(function() {
|
.then(function() {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
saveCompleted();
|
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 });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user