Skip to content

Commit b600b3c

Browse files
javiereguiluzyceruto
authored andcommitted
Renamed ErrorCatcher as ErrorRenderer
1 parent 4e333c1 commit b600b3c

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

components/error_catcher.rst renamed to components/error_renderer.rst

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
.. index::
22
single: Error
33
single: Exception
4-
single: Components; ErrorCatcher
4+
single: Components; ErrorRenderer
55

6-
The ErrorCatcher Component
7-
==========================
6+
The ErrorRenderer Component
7+
===========================
88

9-
The ErrorCatcher component converts PHP errors and exceptions into other
9+
The ErrorRenderer component converts PHP errors and exceptions into other
1010
formats such as JSON and HTML and renders them.
1111

1212
Installation
1313
------------
1414

1515
.. code-block:: terminal
1616
17-
$ composer require symfony/error-catcher
17+
$ composer require symfony/error-renderer
1818
1919
.. include:: /components/require_autoload.rst.inc
2020

2121
Usage
2222
-----
2323

24-
The ErrorCatcher component provides several handlers and renderers to convert
24+
The ErrorRenderer component provides several handlers and renderers to convert
2525
PHP errors and exceptions into other formats easier to debug when working with
2626
HTTP applications.
2727

@@ -33,12 +33,12 @@ Handling PHP Errors and Exceptions
3333
Enabling the Error Handler
3434
~~~~~~~~~~~~~~~~~~~~~~~~~~
3535

36-
The :class:`Symfony\\Component\\ErrorCatcher\\ErrorHandler` class catches PHP
36+
The :class:`Symfony\\Component\\ErrorRenderer\\ErrorHandler` class catches PHP
3737
errors and converts them to exceptions (of class :phpclass:`ErrorException` or
38-
:class:`Symfony\\Component\\ErrorCatcher\\Exception\\FatalErrorException` for
38+
:class:`Symfony\\Component\\ErrorRenderer\\Exception\\FatalErrorException` for
3939
PHP fatal errors)::
4040

41-
use Symfony\Component\ErrorCatcher\ErrorHandler;
41+
use Symfony\Component\ErrorRenderer\ErrorHandler;
4242

4343
ErrorHandler::register();
4444

@@ -48,12 +48,12 @@ application uses the FrameworkBundle because it generates better error logs.
4848
Enabling the Exception Handler
4949
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5050

51-
The :class:`Symfony\\Component\\ErrorCatcher\\ExceptionHandler` class catches
51+
The :class:`Symfony\\Component\\ErrorRenderer\\ExceptionHandler` class catches
5252
uncaught PHP exceptions and converts them to a nice PHP response. It is useful
5353
in :ref:`debug mode <debug-mode>` to replace the default PHP/XDebug output with
5454
something prettier and more useful::
5555

56-
use Symfony\Component\ErrorCatcher\ExceptionHandler;
56+
use Symfony\Component\ErrorRenderer\ExceptionHandler;
5757

5858
ExceptionHandler::register();
5959

@@ -69,9 +69,9 @@ Rendering PHP Errors and Exceptions
6969
Another feature provided by this component are the "error renderers", which
7070
converts PHP errors and exceptions into other formats such as JSON and HTML::
7171

72-
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRenderer;
73-
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
74-
use Symfony\Component\ErrorCatcher\ErrorRenderer\JsonErrorRenderer;
72+
use Symfony\Component\ErrorRenderer\ErrorRenderer\ErrorRenderer;
73+
use Symfony\Component\ErrorRenderer\ErrorRenderer\HtmlErrorRenderer;
74+
use Symfony\Component\ErrorRenderer\ErrorRenderer\JsonErrorRenderer;
7575

7676
$renderers = [
7777
new HtmlErrorRenderer(),
@@ -80,7 +80,7 @@ converts PHP errors and exceptions into other formats such as JSON and HTML::
8080
];
8181
$errorFormatter = new ErrorFormatter($renderers);
8282

83-
/** @var Symfony\Component\ErrorCatcher\Exception\FlattenException */
83+
/** @var Symfony\Component\ErrorRenderer\Exception\FlattenException */
8484
$exception = ...;
8585
/** @var Symfony\Component\HttpFoundation\Request */
8686
$request = ...;
@@ -96,28 +96,28 @@ Built-in Error Renderers
9696

9797
This component provides error renderers for the most common needs:
9898

99-
* :class:`Symfony\\Component\\ErrorCatcher\\ErrorRenderer\\HtmlErrorRenderer`
99+
* :class:`Symfony\\Component\\ErrorRenderer\\ErrorRenderer\\HtmlErrorRenderer`
100100
renders errors in HTML format;
101-
* :class:`Symfony\\Component\\ErrorCatcher\\ErrorRenderer\\JsonErrorRenderer`
101+
* :class:`Symfony\\Component\\ErrorRenderer\\ErrorRenderer\\JsonErrorRenderer`
102102
renders errors in JSON format and it's compliant with the `RFC 7807`_ standard;
103-
* :class:`Symfony\\Component\\ErrorCatcher\\ErrorRenderer\\XmlErrorRenderer`
103+
* :class:`Symfony\\Component\\ErrorRenderer\\ErrorRenderer\\XmlErrorRenderer`
104104
renders errors in XML and Atom formats. It's compliant with the `RFC 7807`_
105105
standard;
106-
* :class:`Symfony\\Component\\ErrorCatcher\\ErrorRenderer\\TxtErrorRenderer`
106+
* :class:`Symfony\\Component\\ErrorRenderer\\ErrorRenderer\\TxtErrorRenderer`
107107
renders errors in plain text format.
108108

109109
Adding a Custom Error Renderer
110110
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111111

112112
Error renderers are PHP classes that implement the
113-
:class:`Symfony\\Component\\ErrorCatcher\\ErrorRenderer\\ErrorRendererInterface`.
113+
:class:`Symfony\\Component\\ErrorRenderer\\ErrorRenderer\\ErrorRendererInterface`.
114114
For example, if you need to render errors in `JSON-LD format`_, create this
115115
class anywhere in your project::
116116

117-
namespace App\ErrorCatcher;
117+
namespace App\ErrorRenderer;
118118

119-
use Symfony\Component\ErrorCatcher\ErrorRenderer\ErrorRendererInterface;
120-
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
119+
use Symfony\Component\ErrorRenderer\ErrorRenderer\ErrorRendererInterface;
120+
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
121121

122122
class JsonLdErrorRenderer implements ErrorRendererInterface
123123
{
@@ -170,7 +170,7 @@ tag.
170170
171171
# config/services.yaml
172172
services:
173-
App\ErrorCatcher\JsonLdErrorRenderer:
173+
App\ErrorRenderer\JsonLdErrorRenderer:
174174
arguments: ['%kernel.debug%']
175175
tags: ['error_catcher.renderer']
176176
@@ -184,7 +184,7 @@ tag.
184184
https://symfony.com/schema/dic/services/services-1.0.xsd">
185185
186186
<services>
187-
<service id="App\ErrorCatcher\JsonLdErrorRenderer">
187+
<service id="App\ErrorRenderer\JsonLdErrorRenderer">
188188
<argument>true</argument>
189189
<tag name="error_catcher.renderer"/>
190190
</service>
@@ -194,7 +194,7 @@ tag.
194194
.. code-block:: php
195195
196196
// config/services.php
197-
use App\ErrorCatcher\JsonLdErrorRenderer;
197+
use App\ErrorRenderer\JsonLdErrorRenderer;
198198
199199
$container->register(JsonLdErrorRenderer::class)
200200
->setArguments([true]);

0 commit comments

Comments
 (0)