2015-05-11 23:05:18 +02:00
|
|
|
|
.. _-recoverRejectionsWith-:
|
|
|
|
|
|
|
|
|
|
|
|
recoverRejectionsWith
|
|
|
|
|
|
=====================
|
|
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
|
---------
|
|
|
|
|
|
|
2015-06-19 15:35:24 +02:00
|
|
|
|
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/BasicDirectives.scala
|
2015-05-11 23:05:18 +02:00
|
|
|
|
:snippet: recoverRejectionsWith
|
|
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
|
-----------
|
|
|
|
|
|
|
2015-10-08 16:26:29 +02:00
|
|
|
|
**Low level directive** – unless you're sure you need to be working on this low-level you might instead
|
|
|
|
|
|
want to try the :ref:`-handleRejections-` directive which provides a nicer DSL for building rejection handlers.
|
|
|
|
|
|
|
2015-10-09 15:19:36 +02:00
|
|
|
|
Transforms rejections from the inner route with an ``immutable.Seq[Rejection] ⇒ Future[RouteResult]`` function.
|
|
|
|
|
|
|
|
|
|
|
|
Asynchronous version of :ref:`-recoverRejections-`.
|
|
|
|
|
|
|
2015-10-08 16:26:29 +02:00
|
|
|
|
See :ref:`-recoverRejections-` (the synchronous equivalent of this directive) for a detailed description.
|
|
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
To learn more about how and why rejections work read the :ref:`rejections-scala` section of the documentation.
|
2015-05-11 23:05:18 +02:00
|
|
|
|
|
|
|
|
|
|
Example
|
|
|
|
|
|
-------
|
|
|
|
|
|
|
2015-09-16 23:50:35 +02:00
|
|
|
|
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala
|
2015-10-08 16:26:29 +02:00
|
|
|
|
:snippet: recoverRejectionsWith
|