diff --git a/frontend/src/hooks/useGetMetricsStepsEffect.ts b/frontend/src/hooks/useGetMetricsStepsEffect.ts index bc7ad8fed..59a4dd159 100644 --- a/frontend/src/hooks/useGetMetricsStepsEffect.ts +++ b/frontend/src/hooks/useGetMetricsStepsEffect.ts @@ -88,7 +88,8 @@ export const useGetMetricsStepsEffect = (): useGetMetricsStepsEffectInterface => setStepFailedStatus(MetricsDataFailStatus.NotFailed); } else if (hasRejected && hasFulfilled) { const rejectedStep = allStepsRes.find((stepInfo) => stepInfo.status === REJECTED); - if ((rejectedStep as PromiseRejectedResult).reason.code == 400) { + const code = (rejectedStep as PromiseRejectedResult).reason.code; + if (code === 400 || code === 401 || code === 403 || code === 404) { setStepFailedStatus(MetricsDataFailStatus.PartialFailed4xx); } else { setStepFailedStatus(MetricsDataFailStatus.PartialFailedTimeout); diff --git a/frontend/src/hooks/useGetSourceControlConfigurationBranchEffect.tsx b/frontend/src/hooks/useGetSourceControlConfigurationBranchEffect.tsx index 2389802da..dfc8a9d9c 100644 --- a/frontend/src/hooks/useGetSourceControlConfigurationBranchEffect.tsx +++ b/frontend/src/hooks/useGetSourceControlConfigurationBranchEffect.tsx @@ -78,7 +78,7 @@ export const useGetSourceControlConfigurationBranchEffect = (): IUseGetSourceCon }), ), ); - if (response.code === 400) { + if (response.code === 400 || response.code === 401 || response.code === 403 || response.code === 404) { setStepFailedStatus(MetricsDataFailStatus.AllFailed4xx); } else if (response.code === 200) { setIsGetBranch(true); diff --git a/frontend/src/hooks/useGetSourceControlConfigurationCrewEffect.tsx b/frontend/src/hooks/useGetSourceControlConfigurationCrewEffect.tsx index 231f208ca..212a9b5cf 100644 --- a/frontend/src/hooks/useGetSourceControlConfigurationCrewEffect.tsx +++ b/frontend/src/hooks/useGetSourceControlConfigurationCrewEffect.tsx @@ -79,7 +79,8 @@ export const useGetSourceControlConfigurationCrewEffect = (): IUseGetSourceContr setStepFailedStatus(MetricsDataFailStatus.NotFailed); } else if (hasRejected && hasFulfilled) { const rejectedStep = allCrewsRes.find((crewInfo) => crewInfo.status === REJECTED); - if ((rejectedStep as PromiseRejectedResult).reason.code == 400) { + const code = (rejectedStep as PromiseRejectedResult).reason.code; + if (code === 400 || code === 401 || code === 403 || code === 404) { setStepFailedStatus(MetricsDataFailStatus.PartialFailed4xx); } else { setStepFailedStatus(MetricsDataFailStatus.PartialFailedTimeout); diff --git a/frontend/src/hooks/useGetSourceControlConfigurationRepoEffect.tsx b/frontend/src/hooks/useGetSourceControlConfigurationRepoEffect.tsx index fed2c3daf..570734da1 100644 --- a/frontend/src/hooks/useGetSourceControlConfigurationRepoEffect.tsx +++ b/frontend/src/hooks/useGetSourceControlConfigurationRepoEffect.tsx @@ -74,7 +74,8 @@ export const useGetSourceControlConfigurationRepoEffect = (): IUseGetSourceContr setStepFailedStatus(MetricsDataFailStatus.NotFailed); } else if (hasRejected && hasFulfilled) { const rejectedStep = allRepoRes.find((repoInfo) => repoInfo.status === REJECTED); - if ((rejectedStep as PromiseRejectedResult).reason.code == 400) { + const code = (rejectedStep as PromiseRejectedResult).reason.code; + if (code === 400 || code === 401 || code === 403 || code === 404) { setStepFailedStatus(MetricsDataFailStatus.PartialFailed4xx); } else { setStepFailedStatus(MetricsDataFailStatus.PartialFailedTimeout);