micropeak: Missing a couple of new exceptions when loading files
authorKeith Packard <keithp@keithp.com>
Sat, 8 Feb 2014 06:45:26 +0000 (22:45 -0800)
committerKeith Packard <keithp@keithp.com>
Sat, 8 Feb 2014 06:45:26 +0000 (22:45 -0800)
The change to keep reading on invalid chars from the serial port
exposed a couple of new exceptions from the MicroData code which the
file loading code needs to cope with.

Signed-off-by: Keith Packard <keithp@keithp.com>
micropeak/MicroPeak.java

index 2a8e2ca63c754e0aa8b4d0e193a212bead74de85..78bc857ec2818746a3fc9f05a5b5d97556286ce0 100644 (file)
@@ -65,6 +65,10 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene
                try {
                        data = new MicroData((InputStream) fis, filename.getName());
                        AltosUIPreferences.set_last_logdir(filename);
+               } catch (MicroData.NonHexcharException nhe) {
+                       data = null;
+               } catch (MicroData.FileEndedException nhe) {
+                       data = null;
                } catch (InterruptedException ie) {
                        data = null;
                } finally {