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

handle iosync error #10

Open
pgherveou opened this issue Jan 25, 2012 · 1 comment
Open

handle iosync error #10

pgherveou opened this issue Jan 25, 2012 · 1 comment
Labels

Comments

@pgherveou
Copy link
Contributor

Hey
I hope i am not bugging you too much with my posts !
When you call Backbone.sync io, "emit" substitute the usual ajax call.

when server is not responding ajax sync call the error function with the http error. Could we handle this kind of error in backbone.io too ?

I am pretty new to Socket io so I don't know what are the best practices to deal with this errors, the simplest handler could look like that maybe

    //...
    var io = model.socket || window.socket || Backbone.socket;

    if (io.socket.connected === false) {
      options.error(new Error("socket is not connected"));
    } else {
      // ...
    }
@ghost ghost assigned logicalparadox Jan 26, 2012
@logicalparadox
Copy link
Contributor

No problem. Input is awesome.

Yeah, this definitely needs to happen but I want to have a test suite to make sure I understand the implications.

I know... No test suite?!?! I think my schedule for tomorrow might have just filled up.

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

No branches or pull requests

2 participants