Skip to content

feat: Support running an after-hook#78

Merged
thced merged 14 commits into
masterfrom
feat/after-hook
May 20, 2026
Merged

feat: Support running an after-hook#78
thced merged 14 commits into
masterfrom
feat/after-hook

Conversation

@thced

@thced thced commented May 20, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@thced thced force-pushed the feat/after-hook branch from 5294028 to 724b3d8 Compare May 20, 2026 12:15
thced added 14 commits May 20, 2026 14:24
Add afterHooks field to HandlerConfig record, add afterHooks list and
afterResponseHook(...) builder method beside interceptor(...), and pass
List.copyOf(afterHooks) into HandlerConfig in build(). Hooks are stored
but not yet fired — execution wiring comes in a later task.
Move inner-chain exception catching from ExceptionFilter into
RequestPreparationFilter so after-hooks can fire inside the still-bound
ScopedValue block (Task 4 of 9 — behavior-preserving).

ExceptionFilter is kept and still wires onto extra-route contexts.
DispatchHandler stashes the rendered Response as an exchange attribute
so fireAfterHooks can pass the real response to global and per-request
hooks. resolveResponse falls back to synthesising a Response from
exchange headers/status on the error path. A try/finally around
runInnerChain ensures hooks fire even when exceptionHandler.handle
itself throws.
@thced thced force-pushed the feat/after-hook branch from 65beca9 to 3d89560 Compare May 20, 2026 12:25
@sonarqubecloud

Copy link
Copy Markdown

@thced thced merged commit e2ecd93 into master May 20, 2026
5 checks passed
@thced thced deleted the feat/after-hook branch May 20, 2026 12:28
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.

2 participants