chore: SampleMapper 불필요한 예외(throws Exception) 제거#37
Closed
LeeBaekHaeng wants to merge 2 commits into
Closed
Conversation
added 2 commits
June 23, 2026 08:57
[Refactor] 샘플 프로젝트 내 불필요한 예외(throws Exception) 제거 및 구조 개선 (또는 프로젝트 규칙에 따라) [2026 컨트리뷰션] 불필요한 예외(throws Exception) 제거 📖 개요 (Description) 전자정부프레임워크 샘플 프로젝트 내에서 관습적으로 사용되던 모호하고 불필요한 throws Exception 선언을 제거하고, 런타임 예외(RuntimeException) 기반의 현대적인 예외 처리 구조로 리팩토링을 진행했습니다. 이 변경을 통해 메서드 시그니처가 간결해지고, 프레젠테이션 레이어와 비즈니스 레이어 간의 예외 전파 구조가 명확해졌습니다. 🛠️ 변경 사항 (Changes) EgovSampleService.java (Interface) 비즈니스 메서드(insertSample, updateSample, deleteSample, selectSample, selectSampleList) 시그니처에서 불필요한 throws Exception 제거 관련 JavaDoc 주석(@exception Exception) 정비 EgovSampleServiceImpl.java (ServiceImpl) 인터페이스 변경에 따른 throws Exception 제거 및 구현부 수정 체크 예외를 발생시키는 ID 생성 서비스(egovIdGnrService.getNextStringId()) 호출부를 try-catch로 감싸 프레임워크 표준 런타임 예외인 BaseRuntimeException으로 전환 데이터 미존재 시 예외 처리를 MessageSource와 LocaleContextHolder를 활용한 런타임 예외 구조로 변경 EgovSampleController.java (Controller) 하위 레이어의 예외 구조 변경에 따라 컨트롤러 메서드 시그니처의 throws Exception 일괄 제거 불필요해진 JavaDoc 주석 정리 및 코드 가독성 향상 🧪 테스트 결과 및 확인 (Test Results) [x] 컴파일 에러 없음 (인터페이스 - 구현체 - 컨트롤러 간 시그니처 일치 확인) [x] 샘플 CRUD 기능 정상 동작 확인 (글 등록, 수정, 조회, 삭제, 페이징 목록 조회) [x] 데이터 미존재 시 정상적으로 예외 메시지 호출 및 다국어(Locale) 처리 검증 💬 추가 사항 (Notes) 본 수정은 2026년 컨트리뷰션 활동의 일환으로 진행되었습니다. 가독성이 떨어지는 구식 예외 선언을 정비함으로써, 샘플 코드를 참고하는 개발자들이 보다 직관적이고 표준적인 Spring/eGovFrame 예외 처리 패턴을 학습하는 데 도움이 될 것으로 기대합니다.
Contributor
|
표준프레임워크에 대한 지속적인 참여에 이번 변경에는 단순 시그니처 정리를 넘어 예외 처리 전략 자체를 바꾸는 부분이 포함되어 있어, 이 점 때문에 현재 구체적으로 selectSample의 if (resultVO == null) throw processException("info.nodata.msg"); 를 BaseRuntimeException + messageSource.getMessage(...) 직접 호출로 바꾼 부분입니다.
이러한 이유로 본 PR은 close하겠습니다. |
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
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.
수정 사유 Reason for modification
소스를 수정한 사유가 무엇인지 체크해 주세요. Please check the reason you modified the source. ([X] X는 대문자여야 합니다.)
수정된 소스 내용 Modified source
검토자를 위해 수정된 소스 내용을 설명해 주세요. Please describe the modified source for reviewers.
변경 이유
throws Exception구문이 코드를 읽는 데 오해를 불러일으킬 수 있어 제거합니다.작업 내용
throws Exception선언 삭제JUnit 테스트 JUnit tests
테스트를 완료하셨으면 다음 항목에 [대문자X]로 표시해 주세요. When you're done testing, check the following items.
테스트 브라우저 Test Browser
테스트를 진행한 브라우저를 선택해 주세요. Please select the browser(s) you ran the test on. (다중 선택 가능 you can select multiple) [X] X는 대문자여야 합니다.
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video
테스트 전과 후의 스크린샷 또는 캡처 영상을 이곳에 첨부해 주세요. Please attach screenshots or video captures of your before and after tests here.