From 3fa55f6dea8363e518fcec20eef17fc1cf4e7ddd Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 21 Oct 2025 10:48:46 -0400 Subject: [PATCH] Integrate experiment toggle --- src/router/methods/error.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/router/methods/error.js b/src/router/methods/error.js index c9f4e30a5..08bd182df 100644 --- a/src/router/methods/error.js +++ b/src/router/methods/error.js @@ -4,6 +4,7 @@ import router from "@/router"; import store from "@/store"; import { storeActions } from "@/constants/store-actions"; import { deleteFunnelCookie } from "@/helpers/heritage-integration/cookie-helper"; +import experimentMixin from "../../mixins/experiment-mixin"; export async function handleSoftError(errorPayload, forceRestart = false) { if (forceRestart) { @@ -20,8 +21,18 @@ export async function handleSoftError(errorPayload, forceRestart = false) { export async function handleHardError(errorPayload) { try { - analyticsMixin?.methods?.pushPageErrorToDataLayer(errorPayload); + const isInStaticErrorExperiment = experimentMixin.methods.hasSettingEqualTo( + 'UseStaticErrorPage', + 'true' + ); + + if(isInStaticErrorExperiment) { + analyticsMixin?.methods?.pushPageErrorToDataLayer(errorPayload); + window.top.location = "/fmg/static/error"; + } else { + handleSoftError(errorPayload, true); + } } finally { - window.top.location = "/fmg/static/error/"; + handleSoftError(errorPayload, true); } }