Merge pull request #962 from automatisch/fix-unreachable-server-errors

fix: correct errors for unreachable servers
This commit is contained in:
Ali BARIN
2023-02-27 21:00:43 +01:00
committed by GitHub

View File

@@ -40,8 +40,9 @@ export default function createHttpClient({
instance.interceptors.response.use(
(response) => response,
async (error) => {
const { config } = error;
const { status } = error.response;
const { config, response } = error;
// Do not destructure `status` from `error.response` because it might not exist
const status = response?.status;
if (
// TODO: provide a `shouldRefreshToken` function in the app