If you are technically asking how to respond to an error, then:
There are several ways to do this.
The simplest is that various transaction functions support success and error callbacks:
myModel.save({property: "value", property2: "value2"},{success: function(model,response){...}, error: function(model,response){...}});
or, in coffeescript:
myModel.save property: "value" property2: "value2 , success: (model, response) -> ... error: (model, response) -> ...
Another way is that since Backbone uses jquery.ajax behind the scenes, use the jquery.ajaxError handler.
If you are looking for a strategy on how, from a product perspective, to handle errors, I think it depends on what you do.
source share