Repository navigation
refactor(afternote): 저장 흐름 예외 3종을 AfternoteFailure sealed 루트로 압축 (#934 4-B) [base: develop] - #1056
Merged
Merged
Conversation
AfternoteAuthoringValidationException 과 UseCase 파일에 얹혀 있던
MemorialVideoSaveException·MemorialPhotoSaveException 을 AfternoteFailure sealed
루트 아래 AuthoringValidation·MediaSave 둘로 줄인다.
매체별로 예외 타입을 나눌 이유가 없었다 — 화면은 둘을 갈라 보지 않고
handleSaveFailure 의 generic 폴백으로 같이 처리하며, 갈라 보던 코드도 없다. 매체는
MediaKind 필드로 구분한다.
MediaSave 에 data class 를 쓰지 않은 건 생성된 equals/hashCode 가 선언 프로퍼티만 덮어
cause 를 무시하기 때문이다. 원본 예외를 cause 로 나르는 것이 이 타입의 계약이고
ResolveMemorialMediaForSaveUseCaseTest 가 그것을 단언한다.
message 는 진단 문구(영문)로 통일했다. 기존 한국어 문구("영상 업로드에 실패했습니다.")는
handleSaveFailure 가 검증 실패가 아닌 실패를 전부 generic 리소스로 폴백시켜 화면에 닿지
않는 값이었다 — Crashlytics 에만 남으므로 나머지 도메인 예외와 정책을 맞췄다.
소비처는 루트로 좁혀 when 을 exhaustive 하게 만들었다. handleSaveFailure 가 검증 실패를
가려낼 때 MediaSave 가 "검증 실패 아님(null)" 으로 명시되고, 실패 유형이 늘면 그 자리가
컴파일 에러로 잡힌다. 기존 else -> null 은 그 구분을 삼켰다.
This was referenced Aug 24, 2026
Closed
Sadturtleman
approved these changes
Aug 24, 2026
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.
#934 의 4-B 단계. 1·2단계는 #1051, 4-A(수신자)는 #1054 — 세 PR 이 다 머지되면 이슈를 닫는다. 파일이 겹치지 않아 머지 순서 제약은 없다.
무엇을
AfternoteAuthoringValidationException과, UseCase 파일에 얹혀 있던MemorialVideoSaveException·MemorialPhotoSaveException→AfternoteFailure루트 아래AuthoringValidation·MediaSave둘로.매체별로 타입을 나눌 이유가 없었다 — 화면은 둘을 갈라 보지 않고
handleSaveFailure의 generic 폴백으로 같이 처리하며, 갈라 보던 코드도 없다. 매체는MediaKind필드로 구분한다(#938 이 도입한 enum).이슈 본문이 못박은 두 제약을 지켰다
cause보존 — 원본 예외를 cause 로 나르는 게 계약이고ResolveMemorialMediaForSaveUseCaseTest가 단언한다.data class금지 — 생성된equals/hashCode가 선언 프로퍼티만 덮어cause를 무시한다. 일반 class 로 뒀다.묶기만 하지 않았다
handleSaveFailure의when이else -> null로 뭉개고 있어sealed이득이 0 이었다. 루트로 좁혀MediaSave가 "검증 실패 아님(null)"으로 명시되게 했고, 실패 유형이 늘면 그 자리가 컴파일 에러로 잡힌다. 그 null 이 곧 "텔레메트리 기록 대상" 이라 분류를 빠뜨리면 조용히 기록에서 빠진다.판단해서 정한 것
message를 진단 문구(영문)로 통일했다. 기존 한국어 문구("영상 업로드에 실패했습니다.")는 화면에 닿지 않는 값이다 —handleSaveFailure가 검증 실패가 아닌 실패를 전부afternote_editor_save_failed_generic리소스로 폴백시키므로, 이 문구는 Crashlytics 에만 남는다. 나머지 도메인 예외의 정책(표시 문구는 리소스, message 는 진단)과 맞췄다.AfternoteAuthoringValidationKind는 값이 하나(RECEIVERS_REQUIRED)뿐이지만 유지했다 — 서버 코드 475 에 대응하는 도메인 어휘라AuthoringValidation자체를 없애면 그 번역 지점이 사라진다.검증
:app:compileDebugUnitTestKotlin:app:compileDebugAndroidTestKotlin(#949 신설)ktlintCheck:feature:afternote:domain·:data·:presentationtestDebugUnitTest시각 검증 해당 없음 — 리소스·Compose 변경 0. baseline 사이클 미실행.
리뷰어에게
AfternoteValidationException(presentation, 던지는 곳 0건)은 건드리지 않았다 — [fix] #603 미사용 비동기 검증 경로 제거 #880 이 그 예외와 짝인AfternoteValidationError.GALLERY_RECEIVERS_REQUIRED및 string 리소스까지 함께 지운다. 여기서 손대면 충돌한다.Memorial{Photo,Video}SaveException을 새when분기로 소비하기 시작하고AfternoteEditorErrorTest가 두 예외를 직접 생성한다. 다만 [refactor] #601 저장 검증과 에디터 오류 상태 통합 #831 은feat/601스택 위(develop 대비 뒤처짐)라 이 PR 을 막지 않는다. 그쪽이 리베이스할 때MediaSave(media)로 맞추면 된다.