altosui: Report error message back from libaltos
[fw/altos] / altosui / AltosSerial.java
index 0a531aa96faa8b2b0b27fc0f412b78c920648231..4cf306d051e478706294010c90c35c6ce7aae104 100644 (file)
@@ -323,8 +323,10 @@ public class AltosSerial implements Runnable {
                }
                altos = device.open();
                if (altos == null) {
+                       final String    message = device.getErrorString();
                        close();
-                       throw new FileNotFoundException(device.toShortString());
+                       throw new FileNotFoundException(String.format("%s (%s)",
+                                                                     device.toShortString(), message));
                }
                if (debug)
                        System.out.printf("Open %s\n", device.getPath());