fix: 프로퍼티 리소스 로딩 실패가 어느 리소스인지 알 수 없는 RuntimeException 으로 끝나던 문제 수정 - #413
Open
comghost wants to merge 1 commit into
Open
fix: 프로퍼티 리소스 로딩 실패가 어느 리소스인지 알 수 없는 RuntimeException 으로 끝나던 문제 수정#413comghost wants to merge 1 commit into
comghost wants to merge 1 commit into
Conversation
EgovPropertyServiceImpl 은 extFileName 으로 지정한 외부 프로퍼티를 읽다가 실패하면 new RuntimeException(e) 만 던진다. 예외 메시지가 원인 예외의 문구뿐이라 여러 파일을 지정한 설정에서는 어느 리소스가 실패했는지 로그만으로 알 수 없고, 기동 실패 원인을 찾으려면 설정을 하나씩 지워 봐야 한다. - 실패한 리소스 설명(Resource.toString(), 예: class path resource [...])을 메시지에 담은 IllegalStateException 을 던진다. 원인 예외는 그대로 보존한다 - IllegalStateException 은 RuntimeException 의 하위 타입이라 기존 catch 는 그대로 동작한다 PropertyServiceLoadFailureTest 3건 추가 — 없는 classpath 리소스와 file 리소스에서 메시지에 리소스가 담기고 원인이 보존되는지, 있는 리소스는 종전처럼 읽히는지.
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
수정된 소스 내용 Modified source
문제
EgovPropertyServiceImpl은extFileName으로 지정한 외부 프로퍼티 파일을 읽다가 실패하면throw new RuntimeException(e)로 끝냅니다. 예외 메시지는 원인 예외의 문구(예:class path resource [...] cannot be opened because it does not exist)를 그대로 담을 뿐이라, 스킴이 없는 이름이나 인코딩 오류처럼 원인 예외가 리소스를 말해 주지않는 경우에는 어느 리소스가 실패했는지 알 수 없습니다. 여러 파일을 지정한 설정에서 기동이 실패하면 설정을 하나씩
지워 가며 찾게 됩니다.
수정
실패한 리소스의 설명(
Resource.toString())을 메시지에 담은IllegalStateException을 던집니다. 원인 예외는 그대로 보존합니다.IllegalStateException은RuntimeException의 하위 타입이므로 기존catch (RuntimeException)은 그대로 동작합니다.finally)는 손대지 않았습니다.JUnit 테스트 JUnit tests
PropertyServiceLoadFailureTest3건 신규,fdl.property모듈 전건 통과.Tests run: 17, Failures: 0, Errors: 0, Skipped: 0Tests run: 17, Failures: 0, Errors: 0, Skipped: 0classpath:리소스(문자열 지정)와 없는file:리소스(filename/encodingMap 지정) 각각 —IllegalStateException메시지에 리소스 이름이 담기고 원인IOException이 보존된다수동 확인: 현재
main(cc2b332) 위에서fdl.property모듈 빌드·테스트가 통과함을 Windows 와 Linux 에서 확인했습니다.테스트 브라우저 Test Browser
해당 없음 — 라이브러리 내부 수정입니다.
테스트 스크린샷 또는 캡처 영상 Test screenshots or captured video
해당 없음 — 위 JUnit 테스트 결과로 갈음합니다.
base:
eGovFramework:main@cc2b332(2026-09-10 fetch 기준, #366~#379 머지 후) · 단일 커밋