Skip to content

Rename the ErrorHandler component to ErrorCatcher #32227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"symfony/dom-crawler": "self.version",
"symfony/dotenv": "self.version",
"symfony/event-dispatcher": "self.version",
"symfony/error-catcher": "self.version",
"symfony/expression-language": "self.version",
"symfony/filesystem": "self.version",
"symfony/finder": "self.version",
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('web.xml');
$loader->load('services.xml');
$loader->load('fragment_renderer.xml');
$loader->load('error_renderer.xml');
$loader->load('error_catcher.xml');

$container->registerAliasForArgument('parameter_bag', PsrContainerInterface::class);

Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\Compiler\RegisterReverseContainerPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\ErrorHandler\DependencyInjection\ErrorHandlerPass;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorCatcher\DependencyInjection\ErrorCatcherPass;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
use Symfony\Component\Form\DependencyInjection\FormPass;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -91,7 +91,7 @@ public function build(ContainerBuilder $container)
KernelEvents::FINISH_REQUEST,
];

$this->addCompilerPassIfExists($container, ErrorHandlerPass::class);
$this->addCompilerPassIfExists($container, ErrorCatcherPass::class);
$container->addCompilerPass(new LoggerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, -32);
$container->addCompilerPass(new RegisterControllerArgumentLocatorsPass());
$container->addCompilerPass(new RemoveEmptyControllerArgumentLocatorsPass(), PassConfig::TYPE_BEFORE_REMOVING);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="error_catcher.error_renderer" class="Symfony\Component\ErrorCatcher\DependencyInjection\ErrorRenderer">
<argument /> <!-- error renderer locator -->
</service>

<service id="error_catcher.renderer.html" class="Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer">
<tag name="error_catcher.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
<argument>%debug.file_link_format%</argument>
</service>

<service id="error_catcher.renderer.json" class="Symfony\Component\ErrorCatcher\ErrorRenderer\JsonErrorRenderer">
<tag name="error_catcher.renderer" />
<argument>%kernel.debug%</argument>
</service>

<service id="error_catcher.renderer.xml" class="Symfony\Component\ErrorCatcher\ErrorRenderer\XmlErrorRenderer">
<tag name="error_catcher.renderer" format="atom" />
<tag name="error_catcher.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
</service>

<service id="error_catcher.renderer.txt" class="Symfony\Component\ErrorCatcher\ErrorRenderer\TxtErrorRenderer">
<tag name="error_catcher.renderer" />
<argument>%kernel.debug%</argument>
<argument>%kernel.charset%</argument>
</service>
</services>
</container>

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Bundle\TwigBundle\Controller;

use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Log\DebugLoggerInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Bundle\TwigBundle\Controller;

use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function process(ContainerBuilder $container)
}

// register the exception controller only if Twig is enabled and required dependencies do exist
if (!class_exists('Symfony\Component\ErrorHandler\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) {
if (!class_exists('Symfony\Component\ErrorCatcher\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) {
$container->removeDefinition('twig.exception_listener');
} elseif ($container->hasParameter('templating.engines')) {
$engines = $container->getParameter('templating.engines');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Symfony\Bundle\TwigBundle\Controller\ExceptionController;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Twig\Environment;
use Twig\Loader\ArrayLoader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Symfony\Bundle\TwigBundle\Controller\PreviewErrorController;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/TwigBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"require": {
"php": "^7.1.3",
"symfony/config": "^4.2|^5.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this requirement should be kept, as we do depend on it (and we should not rely on the transitive dependency coming from elsewhere)

"symfony/error-catcher": "^4.4|^5.0",
"symfony/twig-bridge": "^4.4|^5.0",
"symfony/http-foundation": "^4.3|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
Expand All @@ -35,7 +35,7 @@
"symfony/templating": "^3.4|^4.0|^5.0",
"symfony/translation": "^4.2|^5.0",
"symfony/yaml": "^3.4|^4.0|^5.0",
"symfony/framework-bundle": "^4.3|^5.0",
"symfony/framework-bundle": "^4.4|^5.0",
"symfony/web-link": "^3.4|^4.0|^5.0",
"doctrine/annotations": "~1.0",
"doctrine/cache": "~1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Bundle\WebProfilerBundle\Controller;

use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<argument type="service" id="twig" />
<argument>%kernel.debug%</argument>
<argument type="service" id="debug.file_link_formatter" />
<argument type="service" id="error_handler.renderer.html" on-invalid="null" />
<argument type="service" id="error_catcher.renderer.html" on-invalid="null" />
</service>

<service id="web_profiler.csp.handler" class="Symfony\Bundle\WebProfilerBundle\Csp\ContentSecurityPolicyHandler">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\ErrorCatcher\ErrorRenderer\HtmlErrorRenderer;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
use Symfony\Component\EventDispatcher\EventDispatcher;

Expand Down Expand Up @@ -54,7 +54,7 @@ protected function setUp()
$this->kernel = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\KernelInterface')->getMock();

$this->container = new ContainerBuilder();
$this->container->register('error_handler.renderer.html', HtmlErrorRenderer::class);
$this->container->register('error_catcher.renderer.html', HtmlErrorRenderer::class);
$this->container->register('event_dispatcher', EventDispatcher::class)->setPublic(true);
$this->container->register('router', $this->getMockClass('Symfony\\Component\\Routing\\RouterInterface'))->setPublic(true);
$this->container->register('twig', 'Twig\Environment')->setPublic(true);
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
use Symfony\Component\Console\Output\ConsoleOutputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\Exception\FatalThrowableError;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;

Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/Debug/Debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

namespace Symfony\Component\Debug;

use Symfony\Component\ErrorHandler\BufferingLogger;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\ErrorHandler\ExceptionHandler;
use Symfony\Component\ErrorCatcher\BufferingLogger;
use Symfony\Component\ErrorCatcher\ErrorHandler;
use Symfony\Component\ErrorCatcher\ExceptionHandler;

/**
* Registers all the debug tools.
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Debug/DebugClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function getClassLoader()
public static function enable()
{
// Ensures we don't hit https://bugs.php.net/42098
class_exists('Symfony\Component\ErrorHandler\ErrorHandler');
class_exists('Symfony\Component\ErrorCatcher\ErrorHandler');
class_exists('Psr\Log\LogLevel');

if (!\is_array($functions = spl_autoload_functions())) {
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug;

use Symfony\Component\ErrorHandler\ErrorHandler as BaseErrorHandler;
use Symfony\Component\ErrorCatcher\ErrorHandler as BaseErrorHandler;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ErrorHandler::class, BaseErrorHandler::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\ErrorHandler instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\ErrorHandler instead.
*/
class ErrorHandler extends BaseErrorHandler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug\Exception;

use Symfony\Component\ErrorHandler\Exception\ClassNotFoundException as BaseClassNotFoundException;
use Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException as BaseClassNotFoundException;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', ClassNotFoundException::class, BaseClassNotFoundException::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\ClassNotFoundException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\ClassNotFoundException instead.
*/
class ClassNotFoundException extends BaseClassNotFoundException
{
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/Exception/FatalErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug\Exception;

use Symfony\Component\ErrorHandler\Exception\FatalErrorException as BaseFatalErrorException;
use Symfony\Component\ErrorCatcher\Exception\FatalErrorException as BaseFatalErrorException;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FatalErrorException::class, BaseFatalErrorException::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\FatalErrorException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\FatalErrorException instead.
*/
class FatalErrorException extends BaseFatalErrorException
{
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/Exception/FatalThrowableError.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug\Exception;

use Symfony\Component\ErrorHandler\Exception\FatalThrowableError as BaseFatalThrowableError;
use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError as BaseFatalThrowableError;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FatalThrowableError::class, BaseFatalThrowableError::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\FatalThrowableError instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\FatalThrowableError instead.
*/
class FatalThrowableError extends BaseFatalThrowableError
{
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/Exception/FlattenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug\Exception;

use Symfony\Component\ErrorHandler\Exception\FlattenException as BaseFlattenException;
use Symfony\Component\ErrorCatcher\Exception\FlattenException as BaseFlattenException;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', FlattenException::class, BaseFlattenException::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\FlattenException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\FlattenException instead.
*/
class FlattenException extends BaseFlattenException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug\Exception;

use Symfony\Component\ErrorHandler\Exception\OutOfMemoryException as BaseOutOfMemoryException;
use Symfony\Component\ErrorCatcher\Exception\OutOfMemoryException as BaseOutOfMemoryException;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', OutOfMemoryException::class, BaseOutOfMemoryException::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\OutOfMemoryException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\OutOfMemoryException instead.
*/
class OutOfMemoryException extends BaseOutOfMemoryException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug\Exception;

use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext as BaseSilencedErrorContext;
use Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext as BaseSilencedErrorContext;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', SilencedErrorContext::class, BaseSilencedErrorContext::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\SilencedErrorContext instead.
*/
class SilencedErrorContext extends BaseSilencedErrorContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug\Exception;

use Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException as BaseUndefinedFunctionException;
use Symfony\Component\ErrorCatcher\Exception\UndefinedFunctionException as BaseUndefinedFunctionException;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedFunctionException::class, BaseUndefinedFunctionException::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\UndefinedFunctionException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\UndefinedFunctionException instead.
*/
class UndefinedFunctionException extends BaseUndefinedFunctionException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

namespace Symfony\Component\Debug\Exception;

use Symfony\Component\ErrorHandler\Exception\UndefinedMethodException as BaseUndefinedMethodException;
use Symfony\Component\ErrorCatcher\Exception\UndefinedMethodException as BaseUndefinedMethodException;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.4, use "%s" instead.', UndefinedMethodException::class, BaseUndefinedMethodException::class), E_USER_DEPRECATED);

/**
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorHandler\Exception\UndefinedMethodException instead.
* @deprecated since Symfony 4.4, use Symfony\Component\ErrorCatcher\Exception\UndefinedMethodException instead.
*/
class UndefinedMethodException extends BaseUndefinedMethodException
{
Expand Down
Loading