From 98b872a81a1b00e65faa6911d45ffa9e7d958434 Mon Sep 17 00:00:00 2001 From: Jason Wheeler Date: Mon, 26 Sep 2022 09:46:55 -0400 Subject: [PATCH] refactored error handling around getNavigationMap --- src/router/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 2055226c..ab5cae25 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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; } };