NTP-10634 | JS Crash fixes (#1012)

This commit is contained in:
Mantri Ramkishor
2024-11-18 16:48:24 +05:30
committed by GitHub
parent 9c73e14933
commit 16f3b183dc
2 changed files with 6 additions and 6 deletions

View File

@@ -337,16 +337,16 @@ axiosInstance.interceptors.response.use(
);
if (
config?.headers?.donotHandleError ||
donotHandleErrorOnStatusCode.includes(error.response.status)
donotHandleErrorOnStatusCode.includes(error?.response?.status)
) {
return Promise.reject(error);
}
if (!config || config.retry <= 1 || !errorsToRetry.includes(error.response.status)) {
if (!config || config.retry <= 1 || !errorsToRetry.includes(error?.response?.status)) {
const errorString = getErrorMessage(error);
if (
!config.headers.donotHandleError &&
(config.headers?.showInSpecificComponents
? config.headers.showInSpecificComponents?.includes(getCurrentScreen().name)
? config.headers.showInSpecificComponents?.includes(getCurrentScreen()?.name)
: true)
) {
if (API_STATUS_CODE.GONE !== response.status) {