Skip to content

feat: add ThrowIfInvalid and PipelineValidationException - #110

Merged
bfarmer67 merged 1 commit into
mainfrom
feat/throw-if-invalid
Jul 15, 2026
Merged

feat: add ThrowIfInvalid and PipelineValidationException#110
bfarmer67 merged 1 commit into
mainfrom
feat/throw-if-invalid

Conversation

@bfarmer67

Copy link
Copy Markdown
Contributor

Adds the validation counterpart to ThrowIfError for consuming commands outside HTTP: PipelineValidationException (carries the IValidationResult), IPipelineContext.ThrowIfInvalid(), and ResultMapper unwrapping of captured validation exceptions (422/404/403/401 instead of 500). Includes 17 new tests, validation docs for non-HTTP consumption, README improvements, and middleware scoping tests.

🤖 Generated with Claude Code

Adds the validation counterpart to ThrowIfError for consuming commands
outside HTTP:

- PipelineValidationException carries the IValidationResult
- IPipelineContext.ThrowIfInvalid() throws it when the context holds
  validation failures; cancellation is not considered a failure
- ResultMapper.HandleCommand unwraps a captured PipelineValidationException
  and maps it as a validation response instead of a server error
- validation.md documents consuming commands outside HTTP and fixes the
  stale HandleExceptionsAsync example (real API is WithExceptionHandling)
- README: correct project name, feature bullets, validation section, and
  packages table; docs index lists all pages
- Middleware tests: pin nested hook/wrap scoping to the inner builder

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bfarmer67
bfarmer67 merged commit 37231dd into main Jul 15, 2026
1 check passed
@bfarmer67
bfarmer67 deleted the feat/throw-if-invalid branch July 15, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant