bluetoothviewer icon indicating copy to clipboard operation
bluetoothviewer copied to clipboard

Should handle connection errors more gracefully

Open janosgyerik opened this issue 9 years ago • 1 comments

When connecting to an invalid channel, the app crashes. This is because the connection fails in the constructor of ConnectThread, but the caller doesn't check that, and hits an NPE when trying to use the socket.

  1. It would be better to avoid work (= initialize socket) in the constructor of ConnectThread, which is a bad practice
  2. The caller should handle problems like this gracefully

janosgyerik avatar May 05 '16 08:05 janosgyerik

Perhaps the connection can be done synchronously.

...And instead of logging an exception, the app could show more details of why the connection attempt failed.

...And offer to retry all channels.

...And offer other troubleshooting tips, or explanations, what the user could try, or why it cannot possibly work.

janosgyerik avatar Jan 26 '18 21:01 janosgyerik