Gurgen/SignalR-.net-core-android-client

Application crashes on loss of internet connectivity when starting a WebSocket connection

rahatur opened this issue · 0 comments

If internet connectivity is lost (even for couple of seconds) during a SignalR hub connection then a RuntimeException is thrown. Which causes the entire application to crash. Instead can we throw some sort of network exception?

Sample existing code:

if (this.state.hubConnectionState != HubConnectionState.CONNECTING) {
    return Completable.error(new RuntimeException("Connection closed while trying to connect."));
}