Skip to content

Commit

Permalink
fix: sentry 에러 캐치 못하는 오류 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
healim01 committed Oct 23, 2024
1 parent ea3bac1 commit fd889d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<meta property="og:locale" content="ko-KOR" />
<!-- Preload -->
<link href="https://bang-ggood.com/static/fonts/SUITE-Variable.woff2" rel="preload" as="font" type="font/woff2" />
<link href="https://bang-ggood.com/static//images/category-sprite.webp" rel="preload" as="image" />
<link href="https://bang-ggood.com/static/images/category-sprite.webp" rel="preload" as="image" />
<link href="https://bang-ggood.com/static/images/checkingPageScreen.webp" rel="preload" as="image" />
<link href="https://bang-ggood.com/static/images/customPageScreen.webp" rel="preload" as="image" />
<link href="https://bang-ggood.com/static/images/mainPageScreen.webp" rel="preload" as="image" />
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/apis/fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { captureException } from '@sentry/react';

import APIError from '@/apis/error/APIError';
import { deleteToken, postReissueAccessToken } from '@/apis/user';
import { API_ERROR_MESSAGE } from '@/constants/messages/apiErrorMessage';
Expand Down Expand Up @@ -38,7 +40,9 @@ const handleError = async (response: Response, requestProps: RequestProps) => {
return handleUnauthorizedError(response, requestProps, errorCode);
}

throw new APIError(response.status, errorCode);
const apiError = new APIError(response.status, errorCode);
captureException(apiError);
throw apiError;
};

const handleUnauthorizedError = async (response: Response, requestProps: RequestProps, errorCode: string) => {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ Sentry.init({
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
enabled: process.env.API_ENV === 'production',
});

0 comments on commit fd889d1

Please sign in to comment.