fix: correct errors for unreachable servers
This commit is contained in:
@@ -40,8 +40,9 @@ export default function createHttpClient({
|
|||||||
instance.interceptors.response.use(
|
instance.interceptors.response.use(
|
||||||
(response) => response,
|
(response) => response,
|
||||||
async (error) => {
|
async (error) => {
|
||||||
const { config } = error;
|
const { config, response } = error;
|
||||||
const { status } = error.response;
|
// Do not destructure `status` from `error.response` because it might not exist
|
||||||
|
const status = response?.status;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
// TODO: provide a `shouldRefreshToken` function in the app
|
// TODO: provide a `shouldRefreshToken` function in the app
|
||||||
|
Reference in New Issue
Block a user