8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a1e1355 + ecda51f commit 1e58909Copy full SHA for 1e58909
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