Skip to content

Commit

Permalink
fix: 에러 체크용 알럿창 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
eunbeann committed Jan 19, 2024
1 parent fa91372 commit e5df21f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,22 @@ function Router() {
export default Router;

function fallbackRender({ error, resetErrorBoundary }: any) {
if (error.response.status === 404) {
if (error.response.status === 404 || error.error.response.status === 404) {
resetErrorBoundary();
return <Login />;
} else if (error.response.status === 401) {
} else if (
error.response.status === 401 ||
error.error.response.status === 401
) {
resetErrorBoundary();
localStorage.removeItem('token');
localStorage.removeItem('nickname');
return <Login />;
} else {
location.reload();
alert(
` ${error.response.status},
${error.error.response.status},
에러 발생 : 콘솔창 캡쳐해서 개발자 보내주삼`,
);
}
}

0 comments on commit e5df21f

Please sign in to comment.