diff --git a/src/constants/application-config.js b/src/constants/application-config.js index 7799506f..1e5ee6d8 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -23,7 +23,10 @@ const applicationConfig = Object.freeze({ YAHOO_CALENDAR: 'https://calendar.yahoo.com/?v=60', OUTLOOK_CALENDAR: 'https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent', - FRONTEND_LOGGER_PATH: "/analytics/api/v1/logging" + FRONTEND_LOGGER_PATH: "/analytics/api/v1/logging", + BAILOUT_ON_APPLICATION_ERROR: true, + BAILOUT_ON_API_ERROR: true, + BAILOUT_ON_ROUTER_ERROR: true }); export default applicationConfig; diff --git a/src/constants/bailoutCode.js b/src/constants/bailoutCode.js index fb1ac071..f108570a 100644 --- a/src/constants/bailoutCode.js +++ b/src/constants/bailoutCode.js @@ -12,7 +12,10 @@ const bailoutCode = Object.freeze({ NoPartsAvailable: 10, PartsServiceError: 11, SafeliteNotTheProvider: 12, - VehicleYMMSLookupError: 13 + VehicleYMMSLookupError: 13, + ApplicationError: 14, + ApiError: 15, + RouterError: 16 }); export default bailoutCode; diff --git a/src/constants/bailoutMessage.js b/src/constants/bailoutMessage.js index 1daa702e..77292a1e 100644 --- a/src/constants/bailoutMessage.js +++ b/src/constants/bailoutMessage.js @@ -17,6 +17,18 @@ const bailoutMessage = Object.freeze({ code: bailoutCode.Unknown, message: `An unknown bailout occurred: ${getItemData(error)}` }), + applicationError: (error) => ({ + code: bailoutCode.ApplicationError, + message: `An application error occurred: ${getItemData(error)}` + }), + apiError: (error) => ({ + code: bailoutCode.ApiError, + message: `An API error occurred: ${getItemData(error)}` + }), + routerError: (error) => ({ + code: bailoutCode.RouterError, + message: `A router error occurred: ${getItemData(error)}` + }), saveSessionError: (error) => ({ code: bailoutCode.SaveSessionError, message: `An error occurred during save session: ${getItemData(error)}` diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index 70519fe4..d03bd207 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -10,7 +10,7 @@ When would you like service?
- Your service will take approximately {{ appointmentEstimate }} + Your service will take approximately {{ appointmentEstimate }}.
{ const store = useMainStore(); const cfDistroUrl = applicationConfig.CONSUMER_CF_DISTRO; @@ -66,9 +62,10 @@ export default { [headerKeys.SESSION_SEQUENCE_NUMBER]: sessionKey }; + const url = cfDistroUrl + endpoint; axios({ method, - url: cfDistroUrl + endpoint, + url, data: payloadAndAnalyticsData, crossDomain: true, responseType: 'json', @@ -97,10 +94,11 @@ export default { } if (error.response.status !== 404) { - global.$logger.logError( - `${method}: ${endpoint}: ${error.message}`, - error.response - ); + global.$logger.logError(`${method}: ${endpoint}: ${error.message}`, error.response); + if (bailoutOnError && global.bailoutOnAxiosError !== undefined) + { + global.bailoutOnAxiosError({ url, error }); + } } return reject(error.response); } diff --git a/src/layouts/capability-questions/capability-questions.vue b/src/layouts/capability-questions/capability-questions.vue index f6f4c8a0..c322a54b 100644 --- a/src/layouts/capability-questions/capability-questions.vue +++ b/src/layouts/capability-questions/capability-questions.vue @@ -9,13 +9,12 @@ v-model="selectedAnswers" isRequired :isMetaValid="meta.valid" - :alertFewMoreQuestionsHeader="AlertFewMoreQuestionsHeader" - :alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy" :questionsData="questionsData" :validationRules="rules.optionRequired" :index="currentGlassIndex" @forwardButtonAction="forwardButtonAction" - @backClick="navigateBackByVehicleQuestions" /> + @backClick="navigateBackByVehicleQuestions" + @needHelpClick="requestCallbackBailout" />