-
Notifications
You must be signed in to change notification settings - Fork 48
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_임세빈 3주차 과제 재제출 #124
Open
YIMSEBIN
wants to merge
20
commits into
kakao-tech-campus-2nd-step2:yimsebin
Choose a base branch
from
YIMSEBIN:step4
base: yimsebin
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
orangehouse202
approved these changes
Jul 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
react-query에서 error는 unknown타입이라서 그냥 error.message를 출력하면 에러가 나는데, 스택오버플로우에서 if (error instanceof Error) 를 적용하라는 해결방법을 찾았습니다. 해당 방법 외에 에러를 더 효과적으로 처리하는 방법이 궁금합니다.
catch 문에서 잡히는 에러는 실제로 Error 객체가 아닐 수 있기 때문에 (throw 1, throw 'asdf' 등 다 가능)
instanceof로 검사하는 게 가장 좋은 방법이 맞습니다!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
안녕하세요! 3주차 과제 재제출합니다.
이전 과제에서 react-query 버전 문제로 오류가 있었는데, tanstack으로 이름이 바뀌면서 버전이 꼬였던 문제였어서 해결했습니다!
❓ 궁금한 점
react-query에서 error는 unknown타입이라서 그냥 error.message를 출력하면 에러가 나는데, 스택오버플로우에서
if (error instanceof Error)
를 적용하라는 해결방법을 찾았습니다. 해당 방법 외에 에러를 더 효과적으로 처리하는 방법이 궁금합니다.감사합니다!