diff --git a/js/ublox/UBLOX.js b/js/ublox/UBLOX.js index 7e0f7f2c..b7f800a1 100644 --- a/js/ublox/UBLOX.js +++ b/js/ublox/UBLOX.js @@ -157,14 +157,20 @@ var ublox = (function () { if(req.status == 200) { successCallback(req.response); } else { - failCallback(event); + if(failCallback != null) { + var dec = new TextDecoder('utf-8'); + GUI.log(`http status: ${req.status}: ${dec.decode(req.response)}`) + failCallback(req.response); + } } }; } if (failCallback != null) { req.onerror = (event) => { - failCallback(event); + var dec = new TextDecoder('utf-8'); + GUI.log(i18n.getMessage("gpsAssistnowLoadDataError") + ": Received an unkonwn error when trying to download data.") + failCallback("Unknown error."); } } @@ -172,14 +178,16 @@ var ublox = (function () { req.send(null); } catch(error) { GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError")); - console.log(i18n.getMessage("gpsAssistnowLoadDataError") + ':' + error.toString()); + GUI.log(i18n.getMessage("gpsAssistnowLoadDataError") + ':' + error.toString()); + console.log(i18n.getMessage("gpsAssistnowLoadDataError") + ':' + JSON.stringify(error)); } } function loadError(e) { GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError")); - GUI.log('response error: ' + e.currentTarget.response); + var dec = new TextDecoder('utf-8'); + GUI.log(JSON.stringify(e)); } // For more info on assistnow, check: