MichaelMarner / dart-redux-remote-devtools

Remote Devtools for Dart & Flutter
https://pub.dartlang.org/packages/redux_remote_devtools
MIT License
52 stars 10 forks source link

On web, If dev tools server can't be reached, the Flutter app hard crashes #35

Closed lukepighetti closed 3 years ago

lukepighetti commented 3 years ago

We have the connect wrapped in a try block, but even so, if the server can't be reached in a local web environment, the flutter app will crash and never display the app.

  /// Connect to RemoteDev Tools
  Future<void> connect() async {
    try {
      await _remoteDevTools.connect();
    } catch (e) {
      print('RemoteDevTools unreachable $e');
    }
  }

Error in Chrome console

html_dart2js.dart:31720 WebSocket connection to 'ws://localhost:8000/socketcluster/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Is it possible to get a little gentler error handling in redux_remote_devtools?

lukepighetti commented 3 years ago

If I remove the await keyword it doesn't crash the app, but then we miss the initial actions.

lukepighetti commented 3 years ago

Closed because this is upstream in https://github.com/pauldemarco/socketcluster_client/issues/15