From b8c1dba1cba892a863bb84b4249b193a1711cbe1 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Tue, 29 Jan 2013 17:31:12 -0500 Subject: [PATCH] Catch save error and throw it in the user's face (bug 147). May need to add catches in more places or put in $.ajaxSetup? --- cms/static/js/views/settings/main_settings_view.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cms/static/js/views/settings/main_settings_view.js b/cms/static/js/views/settings/main_settings_view.js index 9037d4510c..704623b56e 100644 --- a/cms/static/js/views/settings/main_settings_view.js +++ b/cms/static/js/views/settings/main_settings_view.js @@ -55,7 +55,10 @@ CMS.Views.ValidatingView = Backbone.View.extend({ var newVal = $(event.currentTarget).val(); if (currentVal != newVal) { this.clearValidationErrors(); - this.model.save(field, newVal); + this.model.save(field, newVal, { error : function(model, error) { + // this handler is for the client:server communication not the vlidation errors which handleValidationError catches + if (error.responseText) window.alert("Error: " + error.responseText); + }}); return true; } else return false;