Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added NoopExceptionListener that does nothing when an exception happens #163

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

Closed
wants to merge 1 commit into from
Closed
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
37 changes: 37 additions & 0 deletions src/EventListener/NoopExceptionListener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Sentry\SentryBundle\EventListener;

use Symfony\Component\Console\Event\ConsoleExceptionEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;

/**
* This class is used to disable sentry exception catching (uncaught exceptions can still be captured via fatal errors)
* Class NoopExceptionListener
* @package Sentry\SentryBundle\EventListener
*/
class NoopExceptionListener extends ExceptionListener
{
/**
* When an exception occurs as part of a web request, this method will be
* triggered for capturing the error.
*
* @param GetResponseForExceptionEvent $event
*/
public function onKernelException(GetResponseForExceptionEvent $event): void
{
// Do nothing
}

/**
* When an exception occurs on the command line, this method will be
* triggered for capturing the error.
*
* @param ConsoleExceptionEvent $event
* @deprecated This method exists for BC with Symfony 3.x
*/
public function onConsoleException(ConsoleExceptionEvent $event): void
{
// Do nothing
}
}