File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -307,9 +307,12 @@ method is just a shortcut to create a special
307
307
:class: `Symfony\\ Component\\ HttpKernel\\ Exception\\ NotFoundHttpException `
308
308
object, which ultimately triggers a 404 HTTP response inside Symfony.
309
309
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::
312
314
315
+ // this exception ultimately generates a 500 status error
313
316
throw new \Exception('Something went wrong!');
314
317
315
318
In every case, an error page is shown to the end user and a full debug
You can’t perform that action at this time.
0 commit comments