+doc,htc #18600,18597 documents where/how to deal with failure in Http

This commit is contained in:
Konrad Malawski 2015-09-29 23:08:11 +02:00
parent 2f2e07666e
commit 573a69e2b9
20 changed files with 532 additions and 60 deletions

View file

@ -4,7 +4,7 @@ failWith
========
Bubbles up the given error through the route structure where it is dealt with by the closest ``handleExceptions``
directive and its ``ExceptionHandler``.
directive and its :class:`ExceptionHandler`.
Signature
@ -19,12 +19,12 @@ Description
``failWith`` explicitly raises an exception that gets bubbled up through the route structure to be picked up by the
nearest ``handleExceptions`` directive. Using ``failWith`` rather than simply throwing an exception enables the route
structure's :ref:`Exception Handling` mechanism to deal with the exception even if the current route is executed
structure's :ref:`exception-handling-scala` mechanism to deal with the exception even if the current route is executed
asynchronously on another thread (e.g. in a ``Future`` or separate actor).
If no ``handleExceptions`` is present above the respective location in the
route structure the top-level routing logic will handle the exception and translate it into a corresponding
``HttpResponse`` using the in-scope ``ExceptionHandler`` (see also the :ref:`Exception Handling` chapter).
``HttpResponse`` using the in-scope ``ExceptionHandler`` (see also the :ref:`exception-handling-scala` chapter).
There is one notable special case: If the given exception is a ``RejectionError`` exception it is *not* bubbled up,
but rather the wrapped exception is unpacked and "executed". This allows the "tunneling" of a rejection via an