diff --git a/src/shared/api/api.ts b/src/shared/api/api.ts index 8e91c2b..c618c6a 100644 --- a/src/shared/api/api.ts +++ b/src/shared/api/api.ts @@ -4,6 +4,16 @@ const baseUrl = process.env.REACT_APP_API_URL as string; const defaultApi = (option?: AxiosRequestConfig): AxiosInstance => { const instance = axios.create({ baseURL: baseUrl, ...option }); + + instance.interceptors.response.use( + (response) => response, + (error) => { + if (process.env.NODE_ENV !== 'production') { + console.error('API Error:', error); + } + return Promise.reject(error); + } + ); return instance; };