telegps: Trap AltosConfigDataException in telegps config
authorKeith Packard <keithp@keithp.com>
Tue, 3 Jun 2014 05:59:23 +0000 (22:59 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 3 Jun 2014 05:59:23 +0000 (22:59 -0700)
This was added for pyro configuration errors in AltosUI

Signed-off-by: Keith Packard <keithp@keithp.com>
telegps/TeleGPSConfig.java

index ffb2d6122bc594433047c7ec232ba3610a6a28ba..22e6a3ac134477dcdc571502b9300ec35e2347e9 100644 (file)
@@ -234,9 +234,15 @@ public class TeleGPSConfig implements ActionListener {
 
                /* Pull data out of the UI and stuff back into our local data record */
 
-               data.get_values(config_ui);
-
-               run_serial_thread(serial_mode_save);
+               try {
+                       data.get_values(config_ui);
+                       run_serial_thread(serial_mode_save);
+               } catch (AltosConfigDataException ae) {
+                       JOptionPane.showMessageDialog(owner,
+                                                     ae.getMessage(),
+                                                     "Configuration Data Error",
+                                                     JOptionPane.ERROR_MESSAGE);
+               }
        }
 
        public void actionPerformed(ActionEvent e) {