@@ -241,8 +241,8 @@ and set a new ``Exception`` object, or do nothing::
241241
242242..note ::
243243
244- If you want to overwrite the status code (which you should not without a good reason),
245- set the ``X-Status-Code `` header::
244+ If you want to overwrite the status code (which you shoulddo not without a good
245+ reason), set the ``X-Status-Code `` header::
246246
247247 $response = new Response(
248248 'Error',
@@ -252,19 +252,20 @@ and set a new ``Exception`` object, or do nothing::
252252 )
253253 );
254254
255- This indeed will skip all checks that Symfony processes on setting response status code.
256- First check that Symfony does is fitting response status code.
257- Symfony leaves set status code as it is if it belongs to one of group:
255+ If you do **not ** set the ``X-Status-Code `` header, then Symfony uses the following
256+ logic to determine the status code:
258257
259- :method: `Symfony\\ Component\\ HttpFoundation\\ Response::isClientError `
258+ * If:method: `Symfony\\ Component\\ HttpFoundation\\ Response::isClientError `,
259+ :method: `Symfony\\ Component\\ HttpFoundation\\ Response::isServerError ` or
260+ :method: `Symfony\\ Component\\ HttpFoundation\\ Response::isRedirect ` is true,
261+ then the status code on your ``Response `` object is used;
260262
261- :method: `Symfony\\ Component\\ HttpFoundation\\ Response::isServerError `
263+ * If the original exception implements
264+ :class: `Symfony\\ Component\\ HttpKernel\\ Exception\\ HttpExceptionInterface `,
265+ then ``getStatusCode() `` is called on the exception and used (the headers
266+ from ``getHeaders() `` are also added);
262267
263- :method: `Symfony\\ Component\\ HttpFoundation\\ Response::isRedirect `
264-
265- If status code is different then Symfony checks instance of raised Exception if it is
266- :class: `Symfony\\ Component\\ HttpKernel\\ Exception\\ HttpExceptionInterface ` then its headers including status code are passed to response.
267- Otherwise status code 500 is set to response.
268+ * If both of the above aren't true, then a 500 status code is used.
268269
269270..seealso ::
270271