-
Notifications
You must be signed in to change notification settings - Fork 1
feat: replace CustomRuntimeException with SecurityException for exist… #340
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
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.
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.
현재
SecurityException을 사용하고 계신데, 이 예외는 자바 보안 모델과 관련이 깊어 현재 컨텍스트에는 의미가 명확하게 와닿지 않을 수 있습니다.스프링 시큐리티의 예외 계층 구조를 활용하여 더 의미가 명확한 예외를 사용하는 것을 추천합니다. 예를 들어,
AuthenticationServiceException은 인증 처리 중 발생하는 서비스 레벨의 문제를 나타내는 데 사용됩니다. "이미 가입된 사용자가 소셜 로그인을 시도하는 경우"를 서비스 로직 상의 인증 실패 케이스로 보고 이 예외를 사용하면 코드의 의도를 더 잘 드러낼 수 있습니다.이렇게 변경하면 스프링 시큐리티의 표준 인증 실패 처리 흐름을 따르면서도, 나중에 코드를 유지보수할 때 예외의 원인을 파악하기 용이해집니다.
다음과 같이 변경하는 것을 제안합니다. (이 경우
org.springframework.security.authentication.AuthenticationServiceException임포트가 필요합니다.)