handleErrors
このコンテンツはまだ日本語訳がありません。
handleErrors(
handler,child):Route
Defined in: src/http/Route.ts:169
Scope an exception handler over child’s subtree — the akka-http
ExceptionHandler analogue, implemented as sugar over a middleware
node so it inherits handler-wrapping (and the WebSocket authorize fold)
for free.
The handler sees the ORIGINAL thrown value — e.g. the HttpError
instance with its status / extra / headers — because DSL-level
wrappers run strictly before any backend’s default error mapping.
Handlers nest outside-in like withMiddleware: the innermost
handleErrors gets first refusal, and returning null delegates
outward. Placed around a withMiddleware(...) node it also catches
that middleware’s throws (e.g. an auth 401).
handleErrors( (err) => err instanceof NotFoundError ? complete(Status.NotFound, ...) : null, path('users', concat(...)),)