Skip to content

Commit ff505d9

Browse files
committed
docs(spec): 취소 예외 전파 및 Validation 다중 에러 보존을 문서에 반영
최근 두 커밋(15a84d4 fix(pipeline), a16107c fix(linq))의 동작 변경이 문서에 반영되지 않아 사용자 안내와 실제 동작이 어긋나던 상태를 바로잡는다. - spec/07-pipeline.md (EN/KR): UsecaseExceptionPipeline 테이블에 "Cancellation" 행 추가 — OperationCanceledException이 래핑되지 않고 재발생됨을 명시 - spec/05-usecase-cqrs.md (EN/KR): FinT LINQ SelectMany 표 아래 "다중 에러 보존" 주석 추가 — .Validation.cs 변환이 ManyErrors로 전부 보존함을 명시 - guides/application/11-usecases-and-cqrs.md (EN/KR): Apply 패턴 4단계 행 확장 — As().ToFin() 변환이 ManyErrors를 유지하며 첫 에러로 축소하지 않음을 명시
1 parent a16107c commit ff505d9

6 files changed

Lines changed: 8 additions & 2 deletions

File tree

Docs.Site/src/content/docs/guides/application/11-usecases-and-cqrs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ private static Fin<Product> CreateProduct(Request request)
344344
| 1 | `Validate()` | Collect validation of all fields as `Validation<Error, T>` |
345345
| 2 | `Apply()` | All validations must succeed before Entity creation proceeds (parallel validation) |
346346
| 3 | `Unwrap()` | Since values are already validated, safely convert to VO |
347-
| 4 | `As().ToFin()` | Convert `Validation` type to `Fin` type |
347+
| 4 | `As().ToFin()` | Convert `Validation` to `Fin`. Multiple errors collected by `Apply` are preserved as `ManyErrors` — never reduced to the first error |
348348

349349
### Validation of Fields Without VOs
350350

Docs.Site/src/content/docs/ko/guides/application/11-usecases-and-cqrs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ private static Fin<Product> CreateProduct(Request request)
344344
| 1 | `Validate()` | 모든 필드의 검증을 `Validation<Error, T>`로 수집 |
345345
| 2 | `Apply()` | 모든 검증이 성공해야 Entity 생성 진행 (병렬 검증) |
346346
| 3 | `Unwrap()` | 이미 검증된 값이므로 안전하게 VO 변환 |
347-
| 4 | `As().ToFin()` | `Validation` 타입을 `Fin` 타입으로 변환 |
347+
| 4 | `As().ToFin()` | `Validation` 타입을 `Fin` 타입으로 변환. `Apply`가 수집한 다중 에러는 `ManyErrors`로 보존되며 첫 번째 에러로 축소되지 않음 |
348348

349349
### VO가 없는 필드의 검증
350350

Docs.Site/src/content/docs/ko/spec/05-usecase-cqrs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ return result.ToFinResponse(() => new DeleteResponse(id));
299299
| `.Validation.cs` | `Validation<Error, A>` | `B` (Map) | `FinT<M, B>` | Validation → FinT 단순 변환 |
300300
| `.Validation.cs` | `FinT<M, A>` | `Validation<Error, B>` | `FinT<M, C>` | FinT 체인 중간에 Validation 사용 |
301301

302+
> **다중 에러 보존:** `.Validation.cs` SelectMany 메서드는 내부적으로 LanguageExt `.ToFin()`을 사용합니다. applicative(`Apply`) 검증에서 수집된 여러 에러는 유실 없이 `ManyErrors`로 보존되며, 첫 번째 에러로 축소되지 않습니다. 관측성 레이어(`ErrorInfoExtractor`)가 `ManyErrors`를 에러 코드 배열로 분해하여 대시보드에 노출합니다.
303+
302304
### Filter 확장 메서드
303305

304306
| 파일 | 대상 타입 | 반환 타입 | 설명 |

Docs.Site/src/content/docs/ko/spec/07-pipeline.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ internal sealed class UsecaseExceptionPipeline<TRequest, TResponse>
105105
|------|------|
106106
| 제약 조건 | `TResponse : IFinResponseFactory<TResponse>` |
107107
| 동작 | `try-catch`로 예외 포착 후 `TResponse.CreateFail(AdapterError.FromException(...))` 반환 |
108+
| 취소 처리 | `OperationCanceledException`(서브타입 `TaskCanceledException` 포함)은 **재발생(throw)되며 래핑되지 않음** — 호출자가 "취소"와 "비즈니스 실패"를 구분할 수 있음 |
108109
| 에러 타입 | `AdapterErrorType.PipelineException` |
109110

110111
### UsecaseValidationPipeline

Docs.Site/src/content/docs/spec/05-usecase-cqrs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,8 @@ return result.ToFinResponse(() => new DeleteResponse(id));
299299
| `.Validation.cs` | `Validation<Error, A>` | `B` (Map) | `FinT<M, B>` | Simple Validation to FinT conversion |
300300
| `.Validation.cs` | `FinT<M, A>` | `Validation<Error, B>` | `FinT<M, C>` | Uses Validation in the middle of FinT chain |
301301

302+
> **Multi-error preservation:** `.Validation.cs` SelectMany methods use LanguageExt's `.ToFin()` internally. Multiple errors produced by applicative (`Apply`) validation are preserved as `ManyErrors` — not reduced to the first error. The observability layer (`ErrorInfoExtractor`) decomposes `ManyErrors` into error-code arrays for dashboards.
303+
302304
### Filter Extension Methods
303305

304306
| File | Target Type | Return Type | Description |

Docs.Site/src/content/docs/spec/07-pipeline.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ internal sealed class UsecaseExceptionPipeline<TRequest, TResponse>
105105
|------|------|
106106
| Constraint | `TResponse : IFinResponseFactory<TResponse>` |
107107
| Behavior | Catches exceptions via `try-catch` and returns `TResponse.CreateFail(AdapterError.FromException(...))` |
108+
| Cancellation | `OperationCanceledException` (and its subtype `TaskCanceledException`) is **re-thrown**, not wrappedso callers can distinguish cancellation from business failure |
108109
| Error Type | `AdapterErrorType.PipelineException` |
109110

110111
### UsecaseValidationPipeline

0 commit comments

Comments
 (0)