You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/tasks/M5-routing-lifecycle/TASK-049.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@
8
8
Convert the existing DR-009 §5.2 dispatch-exception path into a hookable chain. The `internal_error_handler` setter becomes the last-position alias hook so all existing behavior is preserved.
9
9
10
10
**Action Items:**
11
-
-[] Fire `handler_exception` from each catch arm in `webserver_impl::dispatch_resource_handler` (`webserver.cpp:2392` and `webserver.cpp:2400`). Context: `handler_exception_ctx { const http_request& req; std::exception_ptr eptr; std::string_view message; }`. `message` is `e.what()` for the `std::exception` arm and the literal `"unknown exception"` for the `catch (...)` arm.
12
-
-[] Chain semantics: hooks run in registration order; the first to return `hook_action::respond_with(r)` wins and the response is stashed into `mr->response_`. If no hook short-circuits, fall through to `run_internal_error_handler_safely(mr, message)` — preserving today's hardcoded fallback (empty-body 500 if the user `internal_error_handler` itself throws).
13
-
-[]**Alias: `internal_error_handler(fn)`.** Internally register a `handler_exception` hook at LAST position that builds the same response `internal_error_handler` builds today and returns `hook_action::respond_with(...)`. Re-registration replaces the existing alias hook rather than chaining — single-slot semantics preserved for the alias surface (a user can still add their own `handler_exception` hooks before it via `add_hook`).
14
-
-[] A throwing `handler_exception` hook is caught and the chain continues to the next hook (rather than short-circuiting to the hardcoded fallback immediately) — this is the one phase where exception-in-exception-handler does NOT abort the chain, because the whole point of the chain is exception recovery.
15
-
-[] Doxygen on `internal_error_handler` setter notes it is an alias for a last-position `handler_exception` hook and references DR-012.
11
+
-[x] Fire `handler_exception` from each catch arm in `webserver_impl::dispatch_resource_handler` (`webserver.cpp:2392` and `webserver.cpp:2400`). Context: `handler_exception_ctx { const http_request& req; std::exception_ptr eptr; std::string_view message; }`. `message` is `e.what()` for the `std::exception` arm and the literal `"unknown exception"` for the `catch (...)` arm.
12
+
-[x] Chain semantics: hooks run in registration order; the first to return `hook_action::respond_with(r)` wins and the response is stashed into `mr->response_`. If no hook short-circuits, fall through to `run_internal_error_handler_safely(mr, message)` — preserving today's hardcoded fallback (empty-body 500 if the user `internal_error_handler` itself throws).
13
+
-[x]**Alias: `internal_error_handler(fn)`.** Internally register a `handler_exception` hook at LAST position that builds the same response `internal_error_handler` builds today and returns `hook_action::respond_with(...)`. Re-registration replaces the existing alias hook rather than chaining — single-slot semantics preserved for the alias surface (a user can still add their own `handler_exception` hooks before it via `add_hook`).
14
+
-[x] A throwing `handler_exception` hook is caught and the chain continues to the next hook (rather than short-circuiting to the hardcoded fallback immediately) — this is the one phase where exception-in-exception-handler does NOT abort the chain, because the whole point of the chain is exception recovery.
15
+
-[x] Doxygen on `internal_error_handler` setter notes it is an alias for a last-position `handler_exception` hook and references DR-012.
| TASK-047 | Fire `request_received` and `body_chunk` (pre-handler short-circuit) | M5 | Done | TASK-045 |
133
133
| TASK-048 | Fire `route_resolved` and `before_handler`; wire 404/405/auth aliases | M5 | Done | TASK-045, TASK-027, TASK-031 |
134
-
| TASK-049 | Fire `handler_exception`; wire `internal_error_handler` alias | M5 |Not Started| TASK-045, TASK-031 |
134
+
| TASK-049 | Fire `handler_exception`; wire `internal_error_handler` alias | M5 |Done| TASK-045, TASK-031 |
135
135
| TASK-050 | Fire `after_handler` (post-handler short-circuit), `response_sent`, `request_completed`; wire `log_access` alias | M5 | Not Started | TASK-045 |
136
136
| TASK-051 | Per-route hooks (`http_resource::add_hook`) | M5 | Not Started | TASK-045, TASK-048, TASK-049, TASK-050 |
137
137
| TASK-052 | Hook bus documentation, examples, benchmark, stress-test extension (touches back into TASK-040/041/042/043) | M5 | Not Started | TASK-045, TASK-046, TASK-047, TASK-048, TASK-049, TASK-050, TASK-051 |
0 commit comments