1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 09:51:09 +03:00

Remove error response from unexpected server error messaging

This commit is contained in:
gconsidine 2017-06-12 09:52:05 -04:00
parent 1be9c3ba94
commit e91d1e0eb0
2 changed files with 15 additions and 3 deletions

View File

@ -86,7 +86,11 @@ function AtFormController (eventService) {
let handled; let handled;
if (err.status === 400) { if (err.status === 400) {
handled = vm.handleValidationErrors(err.data); handled = vm.handleValidationError(err.data);
}
if (err.status === 500) {
handled = vm.handleUnexpectedError(err);
} }
if (!handled) { if (!handled) {
@ -102,7 +106,16 @@ function AtFormController (eventService) {
} }
}; };
vm.handleValidationErrors = errors => { vm.handleUnexpectedError = err => {
let title = 'Unable to Submit';
let message = 'Unexpected server error. View the console for more information';
vm.modal.show(title, message);
return true;
};
vm.handleValidationError = errors => {
let errorMessageSet = vm.setValidationMessages(errors); let errorMessageSet = vm.setValidationMessages(errors);
if (errorMessageSet) { if (errorMessageSet) {

View File

@ -44,7 +44,6 @@ function httpPost (data) {
} }
function httpPut (changes) { function httpPut (changes) {
console.log(this.get(), changes);
let model = Object.assign(this.get(), changes); let model = Object.assign(this.get(), changes);
let req = { let req = {