8000 minor #12817 [ErrorHandler] Simplified docs (javiereguiluz) · symfony/symfony-docs@3d904aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d904aa

Browse files
committed
minor #12817 [ErrorHandler] Simplified docs (javiereguiluz)
This PR was merged into the 4.4 branch. Discussion ---------- [ErrorHandler] Simplified docs Fixes #12793. The ErrorHandler has changed a lot, so let's simplify the docs to not include two separate sections for exception handling. Commits ------- 775703e [ErrorHandler] Simplified docs
2 parents 79b36fa + 775703e commit 3d904aa

File tree

1 file changed

+6
-30
lines changed

1 file changed

+6
-30
lines changed

components/error_handler.rst

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,9 @@ Installation
2222
Usage
2323
-----
2424

25-
The ErrorHandler component provides several tools to help you debug PHP code:
26-
27-
* An **error handler** that turns PHP errors into exceptions;
28-
* An **exception handler** that turns uncaught PHP exceptions into nice PHP responses;
29-
* A **debug class loader** that provides better errors when a class is not found.
30-
25+
The ErrorHandler component provides several tools to help you debug PHP code.
3126
Call this method (e.g. in your :ref:`front controller <architecture-front-controller>`)
32-
to enable all these features in your application::
27+
to enable all of them in your application::
3328

3429
// public/index.php
3530
use Symfony\Component\ErrorHandler\Debug;
@@ -52,9 +47,10 @@ Turning PHP Errors into Exceptions
5247
----------------------------------
5348

5449
The :class:`Symfony\\Component\\ErrorHandler\\ErrorHandler` class catches PHP
55-
errors and turns them into PHP's :phpclass:`ErrorException` objects, except for
56-
fatal PHP errors, which are turned into Symfony's
57-
:class:`Symfony\\Component\\ErrorHandler\\Exception\\FatalErrorException` objects.
50+
errors and uncaught PHP exceptions and turns them into PHP's
51+
:phpclass:`ErrorException` objects, except for fatal PHP errors, which are
52+
turned into Symfony's :class:`Symfony\\Component\\ErrorHandler\\Exception\\FatalErrorException`
53+
objects.
5854

5955
If the application uses the FrameworkBundle, this error handler is enabled by
6056
default in the :ref:`production environment <configuration-environments>`
@@ -120,26 +116,6 @@ wrap several function calls inside an anonymous function::
120116
return $data;
121117
});
122118

123-
Debugging Uncaught PHP Exceptions
124-
---------------------------------
125-
126-
The :class:`Symfony\\Component\\ErrorHandler\\ExceptionHandler` class catches
127-
uncaught PHP exceptions and turns them into a nice response, so you can debug
128-
them. It is useful in :ref:`debug mode <debug-mode>` to replace the default
129-
PHP/XDebug output with something prettier and more useful.
130-
131-
If the :doc:`HttpFoundation component </components/http_foundation>` is
132-
available, the handler returns a Symfony's
133-
:class:`Symfony\\Component\\HttpFoundation\\Response` object. Otherwise, it returns
134-
a generic PHP response.
135-
136-
Use the following code (e.g. in your :ref:`front controller <architecture-front-controller>`)
137-
to enable this exception handler::
138-
139-
use Symfony\Component\ErrorHandler\ExceptionHandler;
140-
141-
ExceptionHandler::register();
142-
143119
.. _component-debug-class-loader:
144120

145121
Class Loading Debugger

0 commit comments

Comments
 (0)
0