diff options
author | Keith Packard <keithp@keithp.com> | 2010-08-26 23:53:06 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-08-26 23:53:06 -0700 |
commit | 49364608b59de7421ab00d87d2685bc3b5f58411 (patch) | |
tree | 67c8dfb49c93148d8ffc921846f7b43986866194 | |
parent | a16db143fc7ca72dc91e7989420049192114642d (diff) |
altosui: When parsing saved telem files, errors shouldn't abort file
Make syntax errors in telem files just skip the current line and move
on to the next one instead of abandoning the whole file.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | ao-tools/altosui/AltosTelemetryReader.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/ao-tools/altosui/AltosTelemetryReader.java b/ao-tools/altosui/AltosTelemetryReader.java index f1f6788c..a3402f9c 100644 --- a/ao-tools/altosui/AltosTelemetryReader.java +++ b/ao-tools/altosui/AltosTelemetryReader.java @@ -47,20 +47,25 @@ public class AltosTelemetryReader extends AltosReader { try { for (;;) { String line = AltosRecord.gets(input); - if (line == null) + if (line == null) { break; - AltosTelemetry record = new AltosTelemetry(line); - if (record == null) - break; - if (!saw_boost && record.state >= Altos.ao_flight_boost) - { - saw_boost = true; - boost_tick = record.tick; } - records.add(record); + try { + AltosTelemetry record = new AltosTelemetry(line); + if (record == null) + break; + if (!saw_boost && record.state >= Altos.ao_flight_boost) + { + saw_boost = true; + boost_tick = record.tick; + } + records.add(record); + } catch (ParseException pe) { + System.out.printf("parse exception %s\n", pe.getMessage()); + } } } catch (IOException io) { - } catch (ParseException pe) { + System.out.printf("io exception\n"); } record_iterator = records.iterator(); try { |