From d3caae2319da4a5134289578f324dc43fb78261c Mon Sep 17 00:00:00 2001 From: Kai Eichinger Date: Fri, 20 Aug 2021 11:02:36 +0200 Subject: [PATCH] Fix Sentry exception filter not properly working after upgrading the Sentry SDK --- CHANGELOG.md | 6 ++++++ config/services.yaml | 3 +-- src/DependencyInjection/BecklynHostingExtension.php | 8 +++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dc74f8..bbcb934 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +3.2.1 +===== + +* (bug) Fix Sentry exception filter not properly working after upgrading the Sentry SDK. + + 3.2.0 ===== diff --git a/config/services.yaml b/config/services.yaml index 6c6e57b..b9b8157 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -10,8 +10,7 @@ services: resource: '../src/*' exclude: '../src/{DependencyInjection,BecklynHostingBundle.php}' - becklyn_hosting_ignored_errors: - class: Sentry\Integration\IgnoreErrorsIntegration + Sentry\Integration\IgnoreErrorsIntegration: ~ Becklyn\Hosting\Listener\SentryRequestListener: decorates: 'Sentry\SentryBundle\EventListener\RequestListener' diff --git a/src/DependencyInjection/BecklynHostingExtension.php b/src/DependencyInjection/BecklynHostingExtension.php index 3cd0a7b..e976279 100644 --- a/src/DependencyInjection/BecklynHostingExtension.php +++ b/src/DependencyInjection/BecklynHostingExtension.php @@ -5,6 +5,7 @@ use Becklyn\Hosting\Config\HostingConfig; use Becklyn\Hosting\DependencyInjection\CompilerPass\ConfigureSentryPass; use Becklyn\Hosting\Sentry\Integration\UserRoleSentryIntegration; +use Sentry\Integration\IgnoreErrorsIntegration; use Symfony\Component\Config\FileLocator; use Symfony\Component\Console\Exception\CommandNotFoundException; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -46,8 +47,8 @@ public function load (array $configs, ContainerBuilder $container) : void // set release version here, as we need the project name $this->configureSentryPass->setConfig($config["installation"], $config["tier"]); - $container->getDefinition("becklyn_hosting_ignored_errors") - ->setArgument(0, [ + $container->getDefinition(IgnoreErrorsIntegration::class) + ->setArgument('$options', [ "ignore_exceptions" => [ AccessDeniedHttpException::class, AccessDeniedException::class, @@ -55,6 +56,7 @@ public function load (array $configs, ContainerBuilder $container) : void 'Mayd\\Foundation\\Exception\\Request\\RequestMatchException', NotFoundHttpException::class, 'Doctrine\\Migrations\\Exception\\NoMigrationsToExecute', + 'Doctrine\\Migrations\\Generator\\Exception\\NoChangesDetected', 'Mayd\\Foundation\\Exception\\Internal\\InternalRedirectException', ], ]); @@ -69,7 +71,7 @@ public function prepend (ContainerBuilder $container) : void $container->prependExtensionConfig("sentry", [ "options" => [ "integrations" => [ - "becklyn_hosting_ignored_errors", + IgnoreErrorsIntegration::class, UserRoleSentryIntegration::class, ], "in_app_exclude" => [