refactored error handling around getNavigationMap

This commit is contained in:
Jason Wheeler 2022-09-26 09:46:55 -04:00
parent 159f730d6a
commit 98b872a81a

View file

@ -99,10 +99,7 @@ function navigate (scenario, currentRoute, optionalQuery = {}, optionalParams =
if (!matchingScenarioMap){
console.error("No matching scenario found. Please review the routing table.");
return;
} else if (matchingScenarioMap && matchingScenarioMap.error ) {
console.error(matchingScenarioMap.error);
return;
}
}
if (matchingScenarioMap.destinationIssPageValue) {
// We're always pushing the same path, just changing query strings. Make sure our optional query strings get combined with our issPage one.
@ -146,7 +143,8 @@ function getNavigationMap (scenario, currentRoute) {
return maps ? maps.filter(x => x.filter === true || x.filter === undefined)[0] : undefined;
}
catch (e) {
return { error: e };
console.error(e);
return undefined;
}
};