From e91d1e0eb0fefb7b69aabae760d70282167a86d3 Mon Sep 17 00:00:00 2001 From: gconsidine Date: Mon, 12 Jun 2017 09:52:05 -0400 Subject: [PATCH] Remove error response from unexpected server error messaging --- .../lib/components/form/form.directive.js | 17 +++++++++++++++-- awx/ui/client/lib/models/Base.js | 1 - 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/lib/components/form/form.directive.js b/awx/ui/client/lib/components/form/form.directive.js index 041a4cc9d4..7838ace48b 100644 --- a/awx/ui/client/lib/components/form/form.directive.js +++ b/awx/ui/client/lib/components/form/form.directive.js @@ -86,7 +86,11 @@ function AtFormController (eventService) { let handled; if (err.status === 400) { - handled = vm.handleValidationErrors(err.data); + handled = vm.handleValidationError(err.data); + } + + if (err.status === 500) { + handled = vm.handleUnexpectedError(err); } 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); if (errorMessageSet) { diff --git a/awx/ui/client/lib/models/Base.js b/awx/ui/client/lib/models/Base.js index ae3843f036..973561d7a9 100644 --- a/awx/ui/client/lib/models/Base.js +++ b/awx/ui/client/lib/models/Base.js @@ -44,7 +44,6 @@ function httpPost (data) { } function httpPut (changes) { - console.log(this.get(), changes); let model = Object.assign(this.get(), changes); let req = {