From b1cc098f70983da362d0ef1eb912efe0df673a73 Mon Sep 17 00:00:00 2001 From: Jeremy-Z Date: Fri, 8 May 2026 13:25:18 -0400 Subject: [PATCH] Added static error page and updated relevant logic. --- public/static/error/index.html | 103 +++++++++++++++++---------------- src/global-methods.js | 4 +- src/helpers/logger.js | 9 +++ src/router/index.js | 13 ++++- src/store/index.js | 1 + 5 files changed, 76 insertions(+), 54 deletions(-) diff --git a/public/static/error/index.html b/public/static/error/index.html index befcddf4..509b04dd 100644 --- a/public/static/error/index.html +++ b/public/static/error/index.html @@ -78,8 +78,7 @@ body { - --> -

@@ -89,10 +88,9 @@ body {

- --> \ No newline at end of file diff --git a/src/global-methods.js b/src/global-methods.js index 3b97b7fd..c85b0079 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -125,9 +125,9 @@ export default { global.bailoutOnAxiosError(errorData); } else { - console.error("Unable to bailout on the entry page or bailout page."); + console.error("Fatal - Unable to bailout on the entry page or bailout page."); + // Redirect to a generic static error page on fatal error on entry and bailout page. window.top.location = '/static/error'; - // TODO: Redirect to a generic static error page. } } } diff --git a/src/helpers/logger.js b/src/helpers/logger.js index fc22939a..620f3bd0 100644 --- a/src/helpers/logger.js +++ b/src/helpers/logger.js @@ -48,6 +48,15 @@ export class Logger { const store = useMainStore(); const sessionKey = getSessionKeyValue(); + // TODO: Work in progress. +/* + if ( store.applicationUser.logErrorCalls> 10 ) { + console.error("Exceeded maximum log error calls for this session. Further logging will be suppressed to prevent potential infinite loops."); + return; + } + + store.applicationUser.logErrorCalls += 1; +*/ return new Promise((resolve, reject) => { // If running locally or in the Dev environment show the log entries in the console. if ( diff --git a/src/router/index.js b/src/router/index.js index 2a332ab6..75dbf883 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -38,7 +38,7 @@ const routes = [ await analyticsMixin.methods.validateSession(); // Do not run these for the main entry page - as it is not part of the user flow. - if (issPageToUse !== issPageValues.ENTRY_PAGE) { + if (issPageToUse !== issPageValues.ENTRY_PAGE && issPageToUse !== issPageValues.BAILOUT_PAGE) { try { await runExperiments(issPageToUse); } catch (error) { @@ -82,7 +82,14 @@ const routes = [ return next({name: issPageToUse, query: to.query, params: to.params}); } - const routeData = await GetRouteInfoFromPageName(issPageToUse); + var routeData = []; + + try { + routeData = await GetRouteInfoFromPageName(issPageToUse); + } + catch ( error ) { + window.top.location = '/static/error'; + } if (routeData[0].name.toLowerCase() === 'error') { throw new Error('Page not found!'); @@ -284,6 +291,8 @@ function navigate( // Match our maps up and navigate if we have a destination. let matchingScenarioMap = getNavigationMap(scenario, currentRoute); if (!matchingScenarioMap && scenario === navigationScenarios.BAILOUT) { + // TODO: Send to static error page here? + //console.error("No matching map for bailout page - forced bailout page map"); matchingScenarioMap = { destinationIssPageValue: issPageValues.BAILOUT_PAGE } } diff --git a/src/store/index.js b/src/store/index.js index 6733cf7d..cd4216ba 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -245,6 +245,7 @@ export const getDefaultState = () => ({ duplicateOrders: [], hasSentSaveQuoteEmail: null, coverageLookupAttempts: 0, + //logErrorCalls: 0, firstHit: true }, issConfig: {