From 78bc6a797d60b44c90f0071d9b67c710abb740fd Mon Sep 17 00:00:00 2001 From: hanyugeon Date: Wed, 31 Jul 2024 01:41:40 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20axios=EC=97=90=20notFound=20=EB=B6=84?= =?UTF-8?q?=EA=B8=B0=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/core/axios.ts | 6 ------ src/utils/helpers/error.ts | 9 +-------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/apis/core/axios.ts b/src/apis/core/axios.ts index 98477f2f..42712d64 100644 --- a/src/apis/core/axios.ts +++ b/src/apis/core/axios.ts @@ -1,4 +1,3 @@ -import { notFound } from 'next/navigation'; import axios, { CreateAxiosDefaults, InternalAxiosRequestConfig } from 'axios'; import { AuthRefreshIgnoredError } from '@/types/customError'; @@ -7,7 +6,6 @@ import { isAuthFailedError, isAuthRefreshError, isAxiosErrorWithCustomCode, - isNotFoundError, } from '@/utils/helpers'; import { deleteAuthSession, setAuthSession } from '@/server/session'; import { deleteCookie } from '@/utils/cookie'; @@ -43,10 +41,6 @@ const responseHandler = async (error: unknown) => { console.warn(code, message); - if (isNotFoundError(code)) { - notFound(); - } - if (originRequest && isAuthRefreshError(code)) { return silentRefresh(originRequest); } diff --git a/src/utils/helpers/error.ts b/src/utils/helpers/error.ts index 5851a23b..956693b2 100644 --- a/src/utils/helpers/error.ts +++ b/src/utils/helpers/error.ts @@ -15,8 +15,6 @@ const isAuthFailedError = (code: ServiceErrorCode) => const isAuthRefreshError = (code: ServiceErrorCode) => code === 'A4'; -const isNotFoundError = (code: ServiceErrorCode) => code === 'C1'; - /** axios 에러 응답에 custom error code가 포함되어 있는지 확인하며, 이를 보장하는 타입 가드 함수입니다. */ const isAxiosErrorWithCustomCode = ( error: unknown @@ -30,9 +28,4 @@ const isAxiosErrorWithCustomCode = ( ); }; -export { - isAuthFailedError, - isAuthRefreshError, - isNotFoundError, - isAxiosErrorWithCustomCode, -}; +export { isAuthFailedError, isAuthRefreshError, isAxiosErrorWithCustomCode };