diff options
author | Keith Packard <keithp@keithp.com> | 2013-11-12 14:03:42 +0900 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-11-12 14:03:42 +0900 |
commit | 74d73a2cd0b6a228eb396552e1d16685669349c0 (patch) | |
tree | 20095fb73b9c435a8a7092dd55959996125f2c95 /altosui | |
parent | bdd6244d8b4a55c9aa4fb79b0cb1a0727afbc2ac (diff) |
altoslib: Raise ParseException on invalid eeprom format
Make sure the user knows when data are not downloaded successfully
because the UI doesn't understand the eeprom format.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui')
-rw-r--r-- | altosui/AltosEepromDownload.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/altosui/AltosEepromDownload.java b/altosui/AltosEepromDownload.java index 6e2fd061..7ccf26a5 100644 --- a/altosui/AltosEepromDownload.java +++ b/altosui/AltosEepromDownload.java @@ -92,7 +92,7 @@ public class AltosEepromDownload implements Runnable { } } - void CaptureEeprom(AltosEepromChunk eechunk, int log_format) throws IOException { + void CaptureEeprom(AltosEepromChunk eechunk, int log_format) throws IOException, ParseException { boolean any_valid = false; boolean got_flight = false; @@ -138,7 +138,7 @@ public class AltosEepromDownload implements Runnable { CheckFile(false); } - void CaptureLog(AltosEepromLog log) throws IOException, InterruptedException, TimeoutException { + void CaptureLog(AltosEepromLog log) throws IOException, InterruptedException, TimeoutException, ParseException { int block, state_block = 0; int log_format = flights.config_data.log_format; @@ -222,7 +222,11 @@ public class AltosEepromDownload implements Runnable { parse_exception = null; if (log.selected) { monitor.reset(); - CaptureLog(log); + try { + CaptureLog(log); + } catch (ParseException e) { + parse_exception = e; + } } if (parse_exception != null) { failed = true; |