Skip to content

Commit

Permalink
chore: Add debug info
Browse files Browse the repository at this point in the history
  • Loading branch information
stringang committed Sep 23, 2024
1 parent 40fa711 commit 3577136
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frontend/public/co-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const validateStatus = async (
}

if (response.status === 401 && shouldLogout(url)) {
console.log('logout');
authSvc.logout(window.location.pathname, getActiveCluster(storeHandler.getStore()?.getState()));
}

Expand Down Expand Up @@ -140,9 +141,10 @@ export const appInternalFetch = async (url: string, options: RequestInit): Promi
retry = false;
attempt++;
try {
response = await fetch(url, allOptions).then((resp) =>
validateStatus(resp, url, allOptions.method, attempt < 3),
);
response = await fetch(url, allOptions).then((resp) => {
console.log('validate status');
return validateStatus(resp, url, allOptions.method, attempt < 3);
});
} catch (e) {
if (e instanceof RetryError) {
retry = true;
Expand Down

0 comments on commit 3577136

Please sign in to comment.