Skip to content

Commit fdd21c4

Browse files
committed
improved exception controller docs
1 parent bc6fdd8 commit fdd21c4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Resources/doc/4-exception-controller-support.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ mapping, you can do this in your controller:
6666
}
6767
}
6868
69+
In order to make the serialization format of exceptions customizable it is possible to
70+
configure a ``exception_handler``. Users of JMS serializer can further customize the output
71+
by setting a custom ``exception_wrapper_handler``.
72+
73+
.. code-block:: yaml
74+
75+
# app/config/config.yml
76+
fos_rest:
77+
service:
78+
exception_handler: fos_rest.view.exception_wrapper_handler
79+
view:
80+
# only relevant when using the JMS serializer for serialization
81+
exception_wrapper_handler: null
82+
83+
6984
See `this example configuration`_ for more details.
7085

7186
That was it!

0 commit comments

Comments
 (0)