2014-12-18 09:25:33 +01:00
|
|
|
.. _-handleExceptions-:
|
|
|
|
|
|
|
|
|
|
handleExceptions
|
|
|
|
|
================
|
|
|
|
|
|
|
|
|
|
Catches exceptions thrown by the inner route and handles them using the specified ``ExceptionHandler``.
|
|
|
|
|
|
|
|
|
|
Signature
|
|
|
|
|
---------
|
|
|
|
|
|
2015-06-19 15:35:24 +02:00
|
|
|
.. includecode2:: /../../akka-http/src/main/scala/akka/http/scaladsl/server/directives/ExecutionDirectives.scala
|
2014-12-18 09:25:33 +01:00
|
|
|
:snippet: handleExceptions
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
|
-----------
|
|
|
|
|
|
|
|
|
|
Using this directive is an alternative to using a global implicitly defined ``ExceptionHandler`` that
|
|
|
|
|
applies to the complete route.
|
|
|
|
|
|
2015-09-29 23:08:11 +02:00
|
|
|
See :ref:`exception-handling-scala` for general information about options for handling exceptions.
|
2014-12-18 09:25:33 +01:00
|
|
|
|
|
|
|
|
Example
|
|
|
|
|
-------
|
|
|
|
|
|
2015-05-11 23:05:18 +02:00
|
|
|
.. includecode2:: ../../../../code/docs/http/scaladsl/server/directives/ExecutionDirectivesExamplesSpec.scala
|
2014-12-18 09:25:33 +01:00
|
|
|
:snippet: handleExceptions
|