diff options
author | Keith Packard <keithp@keithp.com> | 2014-06-02 22:07:39 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-06-02 22:07:39 -0700 |
commit | ace5f42b5567cff07a61b622171ac364ea8c165d (patch) | |
tree | e24a246841b40711887387a9aff33e51ddce38ad /altosui/AltosConfig.java | |
parent | 206fbb99d28961ce159e3affdd5c96f5e379a603 (diff) |
altosui: Display error message when parsing pyro channel values fails
Build an exception handling chain to get numeric parse errors
propagated all the way back to the original 'save' command and up into
a dialog window, including the pyro channel, field and value that were
in error.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfig.java')
-rw-r--r-- | altosui/AltosConfig.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/altosui/AltosConfig.java b/altosui/AltosConfig.java index 3128114f..2cf69525 100644 --- a/altosui/AltosConfig.java +++ b/altosui/AltosConfig.java @@ -242,9 +242,15 @@ public class AltosConfig 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) { @@ -298,4 +304,4 @@ public class AltosConfig implements ActionListener { } } } -}
\ No newline at end of file +} |