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

what is best way for catching server errors without red screen of death #25

Closed
osmanov opened this issue Apr 24, 2017 · 5 comments
Closed

Comments

@osmanov
Copy link

osmanov commented Apr 24, 2017

Awesome module,thank you very much for your work!
I have a question-what is the best way for catching server errors without red screen of death?

connection.start().done(()=>{
  connection.error( error => {
      //here i get the error from the server
    /*console.log(error.message)-->`it has exceeded the inactivity timeout of 50000 ms. Stopping the connection.` 
    but I can't handle this error here, because the red screen from simulator shoots immediately-`cannot read property supportsKeepAlive of null`*/
  });
})

Thank you!

@epodgaetskiy
Copy link

I have same problem.

@brunobraun
Copy link

Same problem. I created a handler for the AppState change so when the app state = "background" I stop the connection.. something like this:

_handleAppStateChange = (nextAppState) => {
     if(nextAppState === 'background') {
      this.connectionSignalR.stop();
    }
  }

and I restarted the connection in the "disconnected" signalr event...

for my needs, it worked, hope it can help you

@osmanov
Copy link
Author

osmanov commented Jun 20, 2017

Thanks @brunobraun, it helped me.

@dengue8830
Copy link

dengue8830 commented Jul 10, 2017

In my case, stopping it in the background gave me a problem, when I restarted signalr it was stays stuck in connecting state, and only connected when i came back to the app. So i stopped and restarted signalr on 'active' AppState

@manjeets12
Copy link

@brunobraun sample code please, I mean more than that _handleAppStateChange change function.Will be great help
Thanks

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

5 participants