8000 minor #9675 Reword the explanation about HTTP exceptions (javiereguiluz) · symfony/symfony-docs@a5df348 · GitHub
[go: up one dir, main page]

Skip to content

Commit a5df348

Browse files
committed
minor #9675 Reword the explanation about HTTP exceptions (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Reword the explanation about HTTP exceptions On Symfony Slack some people said this was not as clear as it should be. Commits ------- 2308031 Reword the explanation about HTTP exceptions
2 parents d7d2f1a + 2308031 commit a5df348

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

controller.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,12 @@ method is just a shortcut to create a special
307307
:class:`Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException`
308308
object, which ultimately triggers a 404 HTTP response inside Symfony.
309309

310-
Of course, you're free to throw any ``Exception`` class in your controller -
311-
Symfony will automatically return a 500 HTTP response code::
310+
If you throw an exception that extends or is an instance of
311+
:class:`Symfony\\Component\\HttpKernel\\Exception\\HttpException`, Symfony will
312+
use the appropriate HTTP status code. Otherwise, the response will have a 500
313+
HTTP status code::
312314

315+
// this exception ultimately generates a 500 status error
313316
throw new \Exception('Something went wrong!');
314317

315318
In every case, an error page is shown to the end user and a full debug

0 commit comments

Comments
 (0)
0