1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-26 01:35:23 +03:00

Correct assistnow data loading error handling

Fixes #2243
This commit is contained in:
Marcelo Bezerra 2024-12-05 12:59:01 +01:00
parent d6b57e35b4
commit 32a8e6c936

View file

@ -154,7 +154,11 @@ var ublox = (function () {
if (successCallback != null) { if (successCallback != null) {
req.onload = (event) => { req.onload = (event) => {
successCallback(req.response); if(req.status == 200) {
successCallback(req.response);
} else {
failCallback(event);
}
}; };
} }
@ -164,13 +168,18 @@ var ublox = (function () {
} }
} }
req.send(null); try {
req.send(null);
} catch(error) {
GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError"));
console.log(i18n.getMessage("gpsAssistnowLoadDataError") + ':' + error.toString());
}
} }
function loadError(event) { function loadError(event) {
GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError")); GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError"));
console.log(i18n.getMessage("gpsAssistnowLoadDataError") + ':' + event.toString()); console.log(i18n.getMessage("gpsAssistnowLoadDataError") + ':' + event);
} }
// For more info on assistnow, check: // For more info on assistnow, check: