There was an error while loading. Please reload this page.
1 parent a1e1355 commit ecda51fCopy full SHA for ecda51f
book/internals.rst
@@ -377,6 +377,15 @@ and set a new ``Exception`` object, or do nothing:
377
// $event->setException($exception);
378
}
379
380
+.. note::
381
+
382
+ As Symfony ensures that the Response status code is set to the most
383
+ appropriate one depending on the exception, setting the status on the
384
+ response won't work. If you want to overwrite the status code (which you
385
+ should not without a good reason), set the ``X-Status-Code`` header::
386
387
+ return new Response('Error', 404 /* ignored */, array('X-Status-Code' => 200));
388
389
.. index::
390
single: Event Dispatcher
391
0 commit comments