altosui: Catch errors opening USB devices. Limit list to relevant devices
[fw/altos] / ao-tools / altosui / AltosUI.java
index 3dfc89527601d52d6bf685b2174b66ca9e75e883..5c92b9b4d3c0d3ead2638158ab248c89e4de4b6b 100644 (file)
@@ -493,8 +493,9 @@ public class AltosUI extends JFrame {
                                run_display(thread);
                        } catch (FileNotFoundException ee) {
                                JOptionPane.showMessageDialog(AltosUI.this,
-                                                             device.getPath(),
-                                                             "Cannot open serial port",
+                                                             String.format("Cannot open device \"%s\"",
+                                                                           device.getPath()),
+                                                             "Cannot open target device",
                                                              JOptionPane.ERROR_MESSAGE);
                        } catch (IOException ee) {
                                JOptionPane.showMessageDialog(AltosUI.this,