Skip to content
Snippets Groups Projects
Commit d977bc79 authored by rohieb's avatar rohieb Committed by Your Name
Browse files

modules/bus: prevent throwing XML exception when receving invalid HTML from efa

parent a25f351f
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
}
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment