1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-13 11:29:53 +03:00

Merge pull request #2344 from iNavFlight/mmosca-patch-assistnow-error-handling

Improve error reporting for assitnow
This commit is contained in:
Marcelo Bezerra 2025-02-13 20:31:13 +01:00 committed by GitHub
commit 4cffca2dac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,14 +157,20 @@ var ublox = (function () {
if(req.status == 200) { if(req.status == 200) {
successCallback(req.response); successCallback(req.response);
} else { } 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) { if (failCallback != null) {
req.onerror = (event) => { 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,13 +178,16 @@ var ublox = (function () {
req.send(null); req.send(null);
} catch(error) { } catch(error) {
GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError")); 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(event) { function loadError(e) {
GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError")); GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError"));
var dec = new TextDecoder('utf-8');
GUI.log(JSON.stringify(e));
} }
// For more info on assistnow, check: // For more info on assistnow, check: