Integrate experiment toggle

This commit is contained in:
Chloe Herd 2025-10-21 10:48:46 -04:00
parent 487f380c1e
commit 3fa55f6dea

View file

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