Skip to content

Commit 2308031

Browse files
committed
Reword the explanation about HTTP exceptions
1 parent 81c4ee0 commit 2308031

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)