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:
commit
4cffca2dac
1 changed files with 13 additions and 4 deletions
|
@ -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,13 +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(event) {
|
||||
function loadError(e) {
|
||||
GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError"));
|
||||
var dec = new TextDecoder('utf-8');
|
||||
GUI.log(JSON.stringify(e));
|
||||
}
|
||||
|
||||
// For more info on assistnow, check:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue