Skip to content

error handling for failed ajax request with the Model/Collection functions #99

@Kanaye

Description

@Kanaye

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 ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions