diff --git a/src/com/dougkeen/bart/networktasks/EtdContentHandler.java b/src/com/dougkeen/bart/networktasks/EtdContentHandler.java index 5345733..276ec67 100644 --- a/src/com/dougkeen/bart/networktasks/EtdContentHandler.java +++ b/src/com/dougkeen/bart/networktasks/EtdContentHandler.java @@ -1,6 +1,7 @@ package com.dougkeen.bart.networktasks; import java.util.Arrays; +import java.util.Calendar; import java.util.Date; import java.util.List; diff --git a/src/com/dougkeen/bart/networktasks/GetRealTimeDeparturesTask.java b/src/com/dougkeen/bart/networktasks/GetRealTimeDeparturesTask.java index 5b1ae38..bf7fe98 100644 --- a/src/com/dougkeen/bart/networktasks/GetRealTimeDeparturesTask.java +++ b/src/com/dougkeen/bart/networktasks/GetRealTimeDeparturesTask.java @@ -98,7 +98,13 @@ public abstract class GetRealTimeDeparturesTask extends throw new IOException("Server returned blank xml document"); } - Xml.parse(xml, handler); + try { + Xml.parse(xml, handler); + } catch (Exception e) { + mException = new IOException("Server returned malformed xml: " + + xml); + return null; + } final RealTimeDepartures realTimeDepartures = handler .getRealTimeDepartures(); return realTimeDepartures; @@ -121,10 +127,6 @@ public abstract class GetRealTimeDeparturesTask extends mException = new Exception("Could not contact BART system", e); return null; } - } catch (SAXException e) { - mException = new Exception( - "Could not understand response from BART system: " + xml, e); - return null; } }