From e76b9cc32bbcc5176d9bdd6f8d79778024627382 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 28 Jul 2010 12:24:53 -0700 Subject: altosui: Catch errors opening USB devices. Limit list to relevant devices Avoids a segfault when failing to open a device. Limit listed telemetry devices to just TeleDongle units. Signed-off-by: Keith Packard --- ao-tools/altosui/AltosUI.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ao-tools/altosui/AltosUI.java') diff --git a/ao-tools/altosui/AltosUI.java b/ao-tools/altosui/AltosUI.java index 3dfc8952..5c92b9b4 100644 --- a/ao-tools/altosui/AltosUI.java +++ b/ao-tools/altosui/AltosUI.java @@ -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, -- cgit v1.2.3