pekko/akka-docs/rst/scala/http/routing-dsl/directives/basic-directives/cancelRejections.rst

30 lines
848 B
ReStructuredText
Raw Normal View History

.. _-cancelRejections-:
cancelRejections
================
Signature
---------
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/BasicDirectives.scala
:snippet: cancelRejections
Description
-----------
Adds a ``TransformationRejection`` cancelling all rejections created by the inner route for which
the condition argument function returns ``true``.
2015-10-08 16:26:29 +02:00
See also :ref:`-cancelRejection-`, for canceling a specific rejection.
Read :ref:`rejections-scala` to learn more about rejections.
For more advanced handling of rejections refer to the :ref:`-handleRejections-` directive
which provides a nicer DSL for building rejection handlers.
Example
-------
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala
:snippet: cancelRejections-filter-example