Commit b8c1dba1 by Don Mitchell

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?
parent 3669ea5c
...@@ -55,7 +55,10 @@ CMS.Views.ValidatingView = Backbone.View.extend({ ...@@ -55,7 +55,10 @@ CMS.Views.ValidatingView = Backbone.View.extend({
var newVal = $(event.currentTarget).val(); var newVal = $(event.currentTarget).val();
if (currentVal != newVal) { if (currentVal != newVal) {
this.clearValidationErrors(); 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; return true;
} }
else return false; else return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment