2014-12-18 09:25:33 +01:00
|
|
|
|
.. _-mapRejections-:
|
|
|
|
|
|
|
|
|
|
|
|
mapRejections
|
|
|
|
|
|
=============
|
|
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
|
---------
|
|
|
|
|
|
|
2015-06-19 15:35:24 +02:00
|
|
|
|
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/BasicDirectives.scala
|
2014-12-18 09:25:33 +01:00
|
|
|
|
:snippet: mapRejections
|
|
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
|
-----------
|
|
|
|
|
|
|
2015-10-09 15:19:36 +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.
|
|
|
|
|
|
|
2014-12-18 09:25:33 +01:00
|
|
|
|
The ``mapRejections`` directive is used as a building block for :ref:`Custom Directives` to transform a list
|
|
|
|
|
|
of rejections from the inner route to a new list of rejections.
|
|
|
|
|
|
|
|
|
|
|
|
See :ref:`Response Transforming Directives` for similar directives.
|
|
|
|
|
|
|
|
|
|
|
|
Example
|
|
|
|
|
|
-------
|
|
|
|
|
|
|
2015-05-11 23:05:18 +02:00
|
|
|
|
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala
|
2014-12-18 09:25:33 +01:00
|
|
|
|
:snippet: mapRejections
|