Skip to content

Commit

Permalink
Merge pull request #2273 from iNavFlight/mmosca-fix-assistnow-error-h…
Browse files Browse the repository at this point in the history
…andling

Correct assistnow data loading error handling
  • Loading branch information
mmosca authored Dec 5, 2024
2 parents d6b57e3 + a7d644e commit a19eb50
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions js/ublox/UBLOX.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ var ublox = (function () {

if (successCallback != null) {
req.onload = (event) => {
successCallback(req.response);
if(req.status == 200) {
successCallback(req.response);
} else {
failCallback(event);
}
};
}

Expand All @@ -164,13 +168,17 @@ 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) {
GUI.alert(i18n.getMessage("gpsAssistnowLoadDataError"));
console.log(i18n.getMessage("gpsAssistnowLoadDataError") + ':' + event.toString());
}

// For more info on assistnow, check:
Expand Down

0 comments on commit a19eb50

Please sign in to comment.