I think jsblocks should provide an api for the user for handling failed request.
I see some possible ways to register such a handler:
The often in nodejs used way:
myCollection.read(function(data, err) {
// err here as the second argument to not break compatibility
});
Or the event way:
myCollection.on('error' /* or maybe ajax error */, function (err) {...});
Or when creating the Model/Collection:
var MyModel = App.Model({...}, {
options: {
read: {
url: '...',
error: function(err) {...}
}
}
});
What do you think ?