diff --git a/modules/bus.js b/modules/bus.js index 10950e3f895253daa69b191efe51fcff9caaedb2..6361ced808a55ebe79c7365748b86d680dea86f4 100644 --- a/modules/bus.js +++ b/modules/bus.js @@ -26,7 +26,10 @@ function pad(n, width, z) { function fetchData(stop, cb) { url = "http://mobil.efa.de/mobile3/XSLT_DM_REQUEST?outputFormat=XML&useAllStops=1&useRealtime=1&maxAssignedStops=1&itOptionsActive=1&trITMOTvalue100=5&itdLPxx_dest=&sessionID=0&language=en&locationServerActive=1&mode=direct&limit=60&itdLPxx_script=true&type_dm=stop&placeInfo_dm="+CITY+"&name_dm="+stop; httpreq.get(url, {binary: true}, function (err, res) { - cb(XML.parse(iconv.decode(res.body, 'latin1'))); + try { + cb(XML.parse(iconv.decode(res.body, 'latin1'))); + } catch(e) { + } }); }