Ignore logging calls.
This commit is contained in:
parent
001f1efea1
commit
972f55394b
1 changed files with 26 additions and 16 deletions
|
|
@ -6,6 +6,7 @@ import { GaCategories, GaActions, GaLabels } from '@/constants/analytics';
|
||||||
import headerKeys from '@/constants/header-keys';
|
import headerKeys from '@/constants/header-keys';
|
||||||
import axiosResponseInterceptorMessages from '@/constants/axios-response-interceptor-messages.js';
|
import axiosResponseInterceptorMessages from '@/constants/axios-response-interceptor-messages.js';
|
||||||
import { getSessionKeyValue } from '@/helpers/cookie-helper';
|
import { getSessionKeyValue } from '@/helpers/cookie-helper';
|
||||||
|
import endpoints from "@/constants/endpoints";
|
||||||
|
|
||||||
// Add a response interceptor for global axios error handing.
|
// Add a response interceptor for global axios error handing.
|
||||||
axios.interceptors.response.use(
|
axios.interceptors.response.use(
|
||||||
|
|
@ -84,6 +85,14 @@ export default {
|
||||||
return resolve(response);
|
return resolve(response);
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
|
// Add any logging specific endpoints here.
|
||||||
|
if (
|
||||||
|
endpoint.toLowerCase().includes(endpoints.LogIssSessionData.url) ||
|
||||||
|
endpoint.toLowerCase().includes(endpoints.LogPageView.url) ||
|
||||||
|
endpoint.toLowerCase().includes(endpoints.LogCustomEvent.url)
|
||||||
|
) {
|
||||||
|
return resolve({ data: null, error: "Ignore errors when logging" });
|
||||||
|
} else {
|
||||||
if (logApiCall) {
|
if (logApiCall) {
|
||||||
analyticsMixIn.methods.pushEventToGA(
|
analyticsMixIn.methods.pushEventToGA(
|
||||||
GaCategories.API_RESPONSE,
|
GaCategories.API_RESPONSE,
|
||||||
|
|
@ -103,6 +112,7 @@ export default {
|
||||||
}
|
}
|
||||||
return reject(error.response);
|
return reject(error.response);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue