Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

records.reload() callback doesn't allow the detection of an error #389

Open
hypexr opened this issue Jun 30, 2014 · 0 comments
Open

records.reload() callback doesn't allow the detection of an error #389

hypexr opened this issue Jun 30, 2014 · 0 comments

Comments

@hypexr
Copy link

hypexr commented Jun 30, 2014

I have an issue where I not able to detect that a query failed with a response code of 404:

stores.then(function(records) {
        Em.Logger.log("In stores then");
        Em.Logger.log(records);
        records.reload().then(function(records2) {
            Em.Logger.log("In records.reload() then");
            Em.Logger.log(records2);
        }, function(stu2) {
            Em.Logger.log("In records.reload() failed");
        });
    }, function(err) {
        Em.Logger.log("In stores error");
        Em.Logger.log(err);
    });
});

The console output from this query is:

In stores then
In records.reload() then

I would expect that I could handle the 404 in either the second function passed to stores.then or in a second function passed to reload().then, but it looks like reload.then doesn't take a function to handle errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant