Upgrade the ErrorHandler module
Edit on GitHubThis migration guide is a part of the Silex migration effort.
To upgrade the module, do the following:
- Update the module using composer:
composer update spryker/error-handler
- Remove the old service providers, if you have them in the project:
\Spryker\Shared\ErrorHandler\Plugin\ServiceProvider\WhoopsErrorHandlerServiceProvider
- Add new plugins to the dependency providers:
Zed integration
<?php
namespace Pyz\Zed\Application;
use Spryker\Zed\Application\ApplicationDependencyProvider as SprykerApplicationDependencyProvider;
use Spryker\Zed\ErrorHandler\Communication\Plugin\Application\ErrorHandlerApplicationPlugin;
class ApplicationDependencyProvider extends SprykerApplicationDependencyProvider
{
...
/**
* @return \Spryker\Shared\ApplicationExtension\Dependency\Plugin\ApplicationPluginInterface[]
*/
protected function getApplicationPlugins(): array
{
return [
...
new ErrorHandlerApplicationPlugin(),
...
];
}
...
}
Yves integration
<?php
namespace Pyz\Yves\ShopApplication;
use Spryker\Yves\ShopApplication\ShopApplicationDependencyProvider as SprykerShopApplicationDependencyProvider;
use Spryker\Yves\ErrorHandler\Plugin\Application\ErrorHandlerApplicationPlugin;
class ShopApplicationDependencyProvider extends SprykerShopApplicationDependencyProvider
{
...
/**
* @return \Spryker\Shared\ApplicationExtension\Dependency\Plugin\ApplicationPluginInterface[]
*/
protected function getApplicationPlugins(): array
{
return [
...
new ErrorHandlerApplicationPlugin(),
...
];
}
...
}
- Update the
config_*.php
file:
// Replace
$config[ApplicationConstants::IS_PRETTY_ERROR_HANDLER_ENABLED] = true;
// with
$config[ErrorHandlerConstants::IS_PRETTY_ERROR_HANDLER_ENABLED] = true;
Thank you!
For submitting the form