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); } }