Skip to content

docs(mediator): add exception handling to pipeline behavior list#39

Merged
senrecep merged 5 commits into
mainfrom
docs/mediator-readme-exception-handling
May 31, 2026
Merged

docs(mediator): add exception handling to pipeline behavior list#39
senrecep merged 5 commits into
mainfrom
docs/mediator-readme-exception-handling

Conversation

@senrecep
Copy link
Copy Markdown
Owner

Summary

Changes

Before After
validation, logging, caching, transactions validation, logging, exception handling, caching, transactions

Notes

🤖 Generated with Claude Code

senrecep and others added 5 commits May 31, 2026 12:41
Replace Result<int>.Success(42) with implicit int→Result<int> conversion.
Fix S6966 warning: use await cts.CancelAsync() instead of cts.Cancel().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename ValidationBehaviorCache to BehaviorCache (internal, shared by both
ValidationBehavior and ExceptionHandlingBehavior). Extract the duplicated
10-line Expression factory lambda into BehaviorCache.GetOrCreateFactory().
Remove redundant usings from ExceptionHandlingBehavior. Add XML doc to
FailureFactories documenting the bounded-growth design decision.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BehaviorCache is shared infrastructure for all pipeline behaviors.
Moving it out of ValidationBehavior.cs into BehaviorCache.cs reflects
its shared ownership and improves discoverability for future behaviors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change public fields to internal (convention: internal for non-public APIs)
- Add ArgumentException guard in GetOrCreateFactory for non-generic types
- Remove redundant MakeGenericType call: use responseType directly as cache key
  (callers guarantee responseType is already the closed Result<T> generic)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…EADME

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...harpEssentials.Mediator/Behaviors/BehaviorCache.cs 80.00% 1 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@senrecep senrecep merged commit e296e03 into main May 31, 2026
9 checks passed
@senrecep senrecep deleted the docs/mediator-readme-exception-handling branch May 31, 2026 10:36
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