Skip to content

fix: 인증번호 에러 핸들링 Response 속성값 수정#240

Merged
xaexunxang merged 2 commits intodevelopfrom
refact/#239/Certification-error-handling
Jul 11, 2025
Merged

fix: 인증번호 에러 핸들링 Response 속성값 수정#240
xaexunxang merged 2 commits intodevelopfrom
refact/#239/Certification-error-handling

Conversation

@xaexunxang
Copy link
Copy Markdown
Contributor

@xaexunxang xaexunxang commented Jul 10, 2025

사용자 인증번호 에러 핸들링 Response 속성값 error.result에서 error.response.data.result 으로 수정했습니다

Summary by CodeRabbit

  • 버그 수정

    • 인증 코드 전송 및 인증 과정에서 오류 메시지가 올바르게 표시되도록 오류 처리 방식을 개선했습니다.
  • 리팩터

    • 내부 함수 선언 방식을 개선하여 코드 가독성과 일관성을 높였습니다.

@xaexunxang xaexunxang self-assigned this Jul 10, 2025
@xaexunxang xaexunxang added the 🪄 Refactoring 코드 리팩토링 label Jul 10, 2025
@xaexunxang xaexunxang linked an issue Jul 10, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 10, 2025

Walkthrough

내부 훅의 오류 처리 로직이 Axios 오류 응답 구조에 맞게 수정되었으며, usePhoneVerification 훅 내 resetVerification 함수 선언이 const로 변경되었습니다. 외부 API나 내보내는 엔티티의 시그니처에는 변화가 없습니다.

Changes

파일/경로 변경 요약
src/features/join/hooks/useUserHook.ts Axios 오류 응답에서 메시지를 올바르게 추출하도록 오류 처리 로직 수정
src/shared/utils/phoneVerification.ts resetVerification을 const 화살표 함수로 선언 방식 변경

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant useSendCertificationCode
    participant AxiosAPI

    User->>useSendCertificationCode: 인증 코드 전송 요청
    useSendCertificationCode->>AxiosAPI: API 호출
    AxiosAPI-->>useSendCertificationCode: 응답 (성공/오류)
    alt 오류 발생
        useSendCertificationCode->>User: 오류 메시지 추출 후 alert
    else 성공
        useSendCertificationCode->>User: 정상 처리
    end
Loading

Possibly related PRs

  • feat: 전화번호 인증 #236: 동일한 인증 코드 관련 훅들의 오류 처리 및 뮤테이션 함수 시그니처를 수정한 PR로, 본 변경사항과 직접적으로 연결됨.

Suggested labels

🛠️ BugFix

Suggested reviewers

  • hyeeuncho

Poem

🐰
오류 메시지, 이제는 제대로
Axios 속 깊은 곳까지 헤엄쳐
const로 선언도 깔끔하게
깡총깡총, 코드가 더 단단해졌어요!
오늘도 토끼는 버그를 잡으며
행복한 리팩토링을 노래해요.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51eebe1 and 4c99188.

📒 Files selected for processing (2)
  • src/features/join/hooks/useUserHook.ts (2 hunks)
  • src/shared/utils/phoneVerification.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: storybook
🔇 Additional comments (3)
src/shared/utils/phoneVerification.ts (1)

13-13: 함수 선언 개선이 적절합니다.

resetVerification 함수를 const 화살표 함수로 선언한 것은 코드 일관성을 높이고 현대적인 JavaScript/TypeScript 패턴을 따르는 좋은 개선입니다.

src/features/join/hooks/useUserHook.ts (2)

41-42: Axios 에러 핸들링 로직이 올바르게 수정되었습니다.

error.result에서 error.response?.dataerror.response.data.result로 변경한 것은 Axios 에러 응답 구조에 맞는 정확한 수정입니다. 이제 중첩된 응답 객체에서 에러 메시지를 올바르게 추출할 수 있습니다.


60-61: 인증번호 확인 에러 핸들링도 일관되게 수정되었습니다.

useSendCertificationCode와 동일한 방식으로 에러 핸들링이 수정되어 일관성이 유지되었습니다. Axios 에러 객체의 올바른 구조를 따라 에러 메시지에 접근하고 있습니다.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

@xaexunxang xaexunxang changed the title fix: 인증번호 에러 핸들링 Resrponse 속성값 수정 fix: 인증번호 에러 핸들링 Response 속성값 수정 Jul 11, 2025
Copy link
Copy Markdown
Member

@hyeeuncho hyeeuncho left a comment

Choose a reason for hiding this comment

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

수고하셨습니다

@xaexunxang xaexunxang merged commit 4a65046 into develop Jul 11, 2025
2 checks passed
@xaexunxang xaexunxang deleted the refact/#239/Certification-error-handling branch July 11, 2025 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪄 Refactoring 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] 인증번호 에러 핸들링 속성 수정

2 participants