The file cake-sentry/config/bootstrap.php contains the following lines:
if ($isCli) {
(new ConsoleErrorHandler(Configure::read('Error', [])))->register();
} else {
(new ErrorHandler(Configure::read('Error', [])))->register();
}
These classes have been deprecated in CakePHP 4.4 and make my application crash with the following stack trace (simplified):
vendor/connehito/cake-sentry/src/Http/Client.php(144): Sentry\Severity::fromError('notice')
vendor/cakephp/cakephp/src/Error/BaseErrorHandler.php(94): deprecationWarning('Use of `BaseErrorHandler` and subclasses are deprecated...')
vendor/connehito/cake-sentry/config/bootstrap.php(22): Cake\Error\BaseErrorHandler->register()
How to reproduce
Create a CakePHP application.
Add connehito/cake-sentry to the application.
Add the following snippet to Application.php:
public function bootstrap(): void
{
...
if (Configure::read('Environment') != 'localhost') {
$this->addPlugin('Connehito/CakeSentry');
$debugLogConfig = Log::getConfig('debug');
$debugLogConfig['className'] = SentryLog::class;
Log::drop('debug');
Log::setConfig('debug', $debugLogConfig);
\Cake\Event\EventManager::instance()->on(new \App\Log\SentryOptionsContext());
}
}
Description
The file
cake-sentry/config/bootstrap.php
contains the following lines:These classes have been deprecated in CakePHP 4.4 and make my application crash with the following stack trace (simplified):
How to reproduce
connehito/cake-sentry
to the application.Application.php
: