Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fe/feature/#560 error boundary적용 #564

Merged
merged 6 commits into from
Feb 26, 2024

Conversation

Doosies
Copy link
Collaborator

@Doosies Doosies commented Feb 21, 2024

🔮 resolved #560

변경 사항

  • API 에러, 그외의 에러를 최상위에서 처리해줌

고민과 해결 과정

Note

API에서 발생하는 에러에 대해서 APIErrorBoundary안에서 처리 해줘야함

  1. 에러 바운더리를 적용하기 전에는 동작 도중에 알수없는 에러가 발생할 시 동작을 멈췄음
  2. API에러를 1차적으로 처리 못하는 알수없는 에러 발생시 최상위 <UnknownErrorBoundary>에서 처리

나중에 센트리를 적용해 미처 생각치 못한 알수없는 에러 발생시 센트리로 보내주면 좋을듯

(선택) 테스트 결과

ex) 베이스 브랜치에 포함되기 위한 코드는 모두 정상적으로 동작해야 합니다. 결과물에 대한 스크린샷, GIF, 혹은 라이브 데모가 가능하도록 샘플API를 첨부할 수도 있습니다.

@Doosies Doosies self-assigned this Feb 21, 2024
Copy link

cloudflare-workers-and-pages bot commented Feb 24, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3900cfa
Status: ✅  Deploy successful!
Preview URL: https://765a5dac.web09-magicconch.pages.dev
Branch Preview URL: https://fe-feature--560-errorboundar.web09-magicconch.pages.dev

View logs

@Doosies Doosies marked this pull request as ready for review February 25, 2024 08:52
@@ -21,6 +21,7 @@
"html2canvas": "^1.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.12",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 라이브러리가 있구나!!

Comment on lines +33 to +41
this.socket?.on('disconnect', () => {
alert('서버와 연결이 끊겼습니다. 메인 페이지로 이동합니다.');
window.location.href = '/';
});

this.socket?.on('connect_error', () => {
alert('서버와 연결할 수 없습니다. 메인 페이지로 이동합니다.');
window.location.href = '/';
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍👍👍

@Doosies Doosies linked an issue Feb 26, 2024 that may be closed by this pull request
2 tasks
@Doosies Doosies merged commit ac45ebf into dev Feb 26, 2024
2 checks passed
@Doosies Doosies deleted the FE/feature/#560-ErrorBoundary적용 branch February 26, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

✅ ErrorBoundary 적용 ✅ 에러 헨들링 추가
3 participants