diff --git a/Build_God_Game/src/api/index.ts b/Build_God_Game/src/api/index.ts index a763238..066031e 100644 --- a/Build_God_Game/src/api/index.ts +++ b/Build_God_Game/src/api/index.ts @@ -29,6 +29,10 @@ instance.interceptors.response.use( } if (error.response?.status === 404) { window.location.href = "/404"; + return Promise.reject(error) + } + if (error.code === 'ERR_NETWORK' || error.code === 'ECONNABORTED' || !error.response) { + return Promise.reject(error) } const responseData = error.response?.data; if (typeof responseData === "string") {