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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user