diff --git a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_AirwaysFromWaypointPage.js b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_AirwaysFromWaypointPage.js index fd359a3443a..cceb4638532 100644 --- a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_AirwaysFromWaypointPage.js +++ b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_AirwaysFromWaypointPage.js @@ -47,7 +47,7 @@ class A320_Neo_CDU_AirwaysFromWaypointPage { mcdu.onLeftInput[i] = async (value) => { if (value.length > 0) { mcdu.ensureCurrentFlightPlanIsTemporary(async () => { - const airway = await this._getAirway(mcdu, value); + const airway = await this._getAirway(mcdu, value).catch(console.error); if (airway) { A320_Neo_CDU_AirwaysFromWaypointPage.ShowPage(mcdu, waypoint, offset, airway); } else { @@ -68,7 +68,7 @@ class A320_Neo_CDU_AirwaysFromWaypointPage { } else { mcdu.addNewMessage(NXSystemMessages.awyWptMismatch); } - }); + }).catch(console.error); }); } }; @@ -77,12 +77,12 @@ class A320_Neo_CDU_AirwaysFromWaypointPage { subRows[i + 1] = ["\xa0VIA", ""]; mcdu.onLeftInput[i + 1] = async (value) => { if (value.length > 0) { - const toWp = await this._getFirstIntersection(mcdu.flightPlanManager, value, pendingAirway.icaos); + const toWp = await this._getFirstIntersection(mcdu.flightPlanManager, value, pendingAirway.icaos).catch(console.error); if (toWp) { mcdu.ensureCurrentFlightPlanIsTemporary(() => { mcdu.insertWaypointsAlongAirway(toWp, mcdu.flightPlanManager.getEnRouteWaypointsLastIndex() + 1, pendingAirway.name, async (result) => { if (result) { - const airway = await this._getAirway(mcdu, value); + const airway = await this._getAirway(mcdu, value).catch(console.error); if (airway) { A320_Neo_CDU_AirwaysFromWaypointPage.ShowPage(mcdu, waypoint, offset, airway); } else { @@ -91,7 +91,7 @@ class A320_Neo_CDU_AirwaysFromWaypointPage { } else { mcdu.addNewMessage(NXSystemMessages.noIntersectionFound); } - }); + }).catch(console.error); }); } else { mcdu.addNewMessage(NXSystemMessages.noIntersectionFound); @@ -171,14 +171,14 @@ class A320_Neo_CDU_AirwaysFromWaypointPage { const ident = fpm.getWaypoints()[fpm.getEnRouteWaypointsLastIndex()].ident; const identIdx = icaos.findIndex(x => x.substring(4).trim() === ident); for (let i = 0; i < icaos.length - identIdx; i++) { - let res = await this._getRoute(fpm, value, icaos[identIdx + i]); + let res = await this._getRoute(fpm, value, icaos[identIdx + i]).catch(console.error); if (res) { return icaos[identIdx + i].substring(4).trim(); } if (identIdx - i < 0 || i === 0) { continue; } - res = await this._getRoute(fpm, value, icaos[identIdx - i]); + res = await this._getRoute(fpm, value, icaos[identIdx - i]).catch(console.error); if (res) { return icaos[identIdx - i].substring(4).trim(); } diff --git a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_AvailableDeparturesPage.js b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_AvailableDeparturesPage.js index e62258b8bfa..198af997f10 100644 --- a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_AvailableDeparturesPage.js +++ b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/CDU/A320_Neo_CDU_AvailableDeparturesPage.js @@ -118,7 +118,7 @@ class CDUAvailableDeparturesPage { mcdu.onRightInput[i + 1] = () => { mcdu.flightPlanManager.setDepartureEnRouteTransitionIndex(enRouteTransitionIndex, () => { CDUAvailableDeparturesPage.ShowPage(mcdu, airport, 0, true); - }); + }).catch(console.error); }; } } diff --git a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js index 534cc252f83..65de170984c 100644 --- a/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js +++ b/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js @@ -240,7 +240,7 @@ class FMCMainDisplay extends BaseAirliners { }; const arrivalIndex = this.flightPlanManager.getArrivalProcIndex(); if (arrivalIndex >= 0) { - this.flightPlanManager.setArrivalProcIndex(arrivalIndex, callback); + this.flightPlanManager.setArrivalProcIndex(arrivalIndex, callback).catch(console.error); } else { callback(); } @@ -1661,8 +1661,8 @@ class FMCMainDisplay extends BaseAirliners { this.flightPlanManager.setDepartureProcIndex(-1, () => { this.flightPlanManager.setOriginRunwayIndex(runwayIndex, () => { return callback(true); - }); - }); + }).catch(console.error); + }).catch(console.error); }); } @@ -1677,13 +1677,13 @@ class FMCMainDisplay extends BaseAirliners { this.flightPlanManager.setDepartureRunwayIndex(-1, () => { this.flightPlanManager.setOriginRunwayIndex(-1, () => { return callback(true); - }); - }); + }).catch(console.error); + }).catch(console.error); } else if (routeOriginInfo instanceof AirportInfo) { if (routeOriginInfo.oneWayRunways[runwayIndex]) { this.flightPlanManager.setDepartureRunwayIndex(runwayIndex, () => { return callback(true); - }); + }).catch(console.error); } } else { this.addNewMessage(NXSystemMessages.notInDatabase); @@ -1704,48 +1704,48 @@ class FMCMainDisplay extends BaseAirliners { if (departureRunwayIndex >= -1) { return this.flightPlanManager.setDepartureRunwayIndex(departureRunwayIndex, () => { return callback(true); - }); + }).catch(console.error); } } return callback(true); - }); + }).catch(console.error); }); } setApproachTransitionIndex(transitionIndex, callback = EmptyCallback.Boolean) { - console.log("FMCMainDisplay: setApproachTransitionIndex = ", transitionIndex); + //console.log("FMCMainDisplay: setApproachTransitionIndex = ", transitionIndex); const arrivalIndex = this.flightPlanManager.getArrivalProcIndex(); this.ensureCurrentFlightPlanIsTemporary(() => { this.flightPlanManager.setApproachTransitionIndex(transitionIndex, () => { this.flightPlanManager.setArrivalProcIndex(arrivalIndex, () => { callback(true); - }); - }); + }).catch(console.error); + }).catch(console.error); }); } setArrivalProcIndex(arrivalIndex, callback = EmptyCallback.Boolean) { - console.log("FMCMainDisplay: setArrivalProcIndex = ", arrivalIndex); + //console.log("FMCMainDisplay: setArrivalProcIndex = ", arrivalIndex); this.ensureCurrentFlightPlanIsTemporary(() => { this.flightPlanManager.setArrivalProcIndex(arrivalIndex, () => { callback(true); - }); + }).catch(console.error); }); } setArrivalIndex(arrivalIndex, transitionIndex, callback = EmptyCallback.Boolean) { - console.log("FMCMainDisplay: setArrivalIndex: arrivalIndex=", arrivalIndex, " transitionIndex=", transitionIndex); + //console.log("FMCMainDisplay: setArrivalIndex: arrivalIndex=", arrivalIndex, " transitionIndex=", transitionIndex); this.ensureCurrentFlightPlanIsTemporary(() => { this.flightPlanManager.setArrivalEnRouteTransitionIndex(transitionIndex, () => { this.flightPlanManager.setArrivalProcIndex(arrivalIndex, () => { callback(true); - }); - }); + }).catch(console.error); + }).catch(console.error); }); } setApproachIndex(approachIndex, callback = EmptyCallback.Boolean) { - console.log("FMCMainDisplay: setApproachIndex = ", approachIndex); + //console.log("FMCMainDisplay: setApproachIndex = ", approachIndex); this.ensureCurrentFlightPlanIsTemporary(() => { this.flightPlanManager.setApproachIndex(approachIndex, () => { const approach = this.flightPlanManager.getApproach(); @@ -1757,7 +1757,7 @@ class FMCMainDisplay extends BaseAirliners { } this.clearAutotunedIls(); callback(true); - }); + }).catch(console.error); }); } @@ -2003,7 +2003,7 @@ class FMCMainDisplay extends BaseAirliners { }); }; - await syncInsertWaypointByIcao(airway.icaos[firstIndex + i * inc], index + i); + await syncInsertWaypointByIcao(airway.icaos[firstIndex + i * inc], index + i).catch(console.error); } callback(true); return; @@ -2109,7 +2109,7 @@ class FMCMainDisplay extends BaseAirliners { this.flightPlanManager.setDestination(airportTo.icao, () => { this.tmpOrigin = airportTo.ident; callback(true); - }); + }).catch(console.error); }); } else { this.addNewMessage(NXSystemMessages.notInDatabase); diff --git a/src/fmgc/src/flightplanning/FlightPlanManager.ts b/src/fmgc/src/flightplanning/FlightPlanManager.ts index 6d0509c1171..62c30b72046 100644 --- a/src/fmgc/src/flightplanning/FlightPlanManager.ts +++ b/src/fmgc/src/flightplanning/FlightPlanManager.ts @@ -1066,7 +1066,7 @@ export class FlightPlanManager { if (currentFlightPlan.procedureDetails.departureIndex !== index) { currentFlightPlan.procedureDetails.departureIndex = index; - await currentFlightPlan.buildDeparture(); + await currentFlightPlan.buildDeparture().catch(console.error); this._updateFlightPlanVersion().catch(console.error); } @@ -1084,7 +1084,7 @@ export class FlightPlanManager { if (currentFlightPlan.procedureDetails.departureRunwayIndex !== index) { currentFlightPlan.procedureDetails.departureRunwayIndex = index; - await currentFlightPlan.buildDeparture(); + await currentFlightPlan.buildDeparture().catch(console.error); this._updateFlightPlanVersion().catch(console.error); }