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?
This commit is contained in:
Don Mitchell
2013-01-29 17:31:12 -05:00
parent 3669ea5c97
commit b8c1dba1cb

View File

@@ -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;