Skip to content

Commit 78bc6a7

Browse files
committed
chore: axios에 notFound 분기 제거
1 parent 2e64603 commit 78bc6a7

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

src/apis/core/axios.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { notFound } from 'next/navigation';
21
import axios, { CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios';
32

43
import { AuthRefreshIgnoredError } from '@/types/customError';
@@ -7,7 +6,6 @@ import {
76
isAuthFailedError,
87
isAuthRefreshError,
98
isAxiosErrorWithCustomCode,
10-
isNotFoundError,
119
} from '@/utils/helpers';
1210
import { deleteAuthSession, setAuthSession } from '@/server/session';
1311
import { deleteCookie } from '@/utils/cookie';
@@ -43,10 +41,6 @@ const responseHandler = async (error: unknown) => {
4341

4442
console.warn(code, message);
4543

46-
if (isNotFoundError(code)) {
47-
notFound();
48-
}
49-
5044
if (originRequest && isAuthRefreshError(code)) {
5145
return silentRefresh(originRequest);
5246
}

src/utils/helpers/error.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ const isAuthFailedError = (code: ServiceErrorCode) =>
1515

1616
const isAuthRefreshError = (code: ServiceErrorCode) => code === 'A4';
1717

18-
const isNotFoundError = (code: ServiceErrorCode) => code === 'C1';
19-
2018
/** axios 에러 응답에 custom error code가 포함되어 있는지 확인하며, 이를 보장하는 타입 가드 함수입니다. */
2119
const isAxiosErrorWithCustomCode = (
2220
error: unknown
@@ -30,9 +28,4 @@ const isAxiosErrorWithCustomCode = (
3028
);
3129
};
3230

33-
export {
34-
isAuthFailedError,
35-
isAuthRefreshError,
36-
isNotFoundError,
37-
isAxiosErrorWithCustomCode,
38-
};
31+
export { isAuthFailedError, isAuthRefreshError, isAxiosErrorWithCustomCode };

0 commit comments

Comments
 (0)