Skip to content

Commit

Permalink
Fix Sentry exception filter not properly working after upgrading the …
Browse files Browse the repository at this point in the history
…Sentry SDK
  • Loading branch information
Kai Eichinger committed Aug 20, 2021
1 parent fd2adfd commit d3caae2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.2.1
=====

* (bug) Fix Sentry exception filter not properly working after upgrading the Sentry SDK.


3.2.0
=====

Expand Down
3 changes: 1 addition & 2 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 5 additions & 3 deletions src/DependencyInjection/BecklynHostingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -46,15 +47,16 @@ 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,
CommandNotFoundException::class,
'Mayd\\Foundation\\Exception\\Request\\RequestMatchException',
NotFoundHttpException::class,
'Doctrine\\Migrations\\Exception\\NoMigrationsToExecute',
'Doctrine\\Migrations\\Generator\\Exception\\NoChangesDetected',
'Mayd\\Foundation\\Exception\\Internal\\InternalRedirectException',
],
]);
Expand All @@ -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" => [
Expand Down

0 comments on commit d3caae2

Please sign in to comment.